Ask Question
26 February, 11:40

Write a program that displays, ten numbers per line, all the numbers from 100 to 1,000 that are divisible by 5 and 6. the numbers are separated by exactly one space.

+1
Answers (1)
  1. 26 February, 12:28
    0
    int i = 0;

    for (int n = 100; n < = 1000; n++) {

    if (((n % 5) = = 0) && ((n % 6) = = 0)) {

    printf ("%d", n);

    if (++i < 10) {

    printf (" ");

    }

    else {

    printf ("/n");

    i = 0;

    }

    }

    }

    The output is the following:

    120 150 180 210 240 270 300 330 360 390

    420 450 480 510 540 570 600 630 660 690

    720 750 780 810 840 870 900 930 960 990
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that displays, ten numbers per line, all the numbers from 100 to 1,000 that are divisible by 5 and 6. the numbers are ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers