Ask Question
10 January, 16:38

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. 10 January, 16:41
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers