Respuesta :

tonb
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

The program to this question can be defined as follows:

Program Explanation:

  • Defining the header file.
  • Defining the main method.
  • Inside the method, two integer variable "i,c" is defined.
  • After defining a varaible, a for loop is declared that counts values from 100 to 1000, in which it use if block that check value is divisiable by 5 and 6.
  • Inside to loop it use "c" variable that seprates 10 rows, in which it prints the calculated values.

Program:

#include <stdio.h>//header file

int main()//defining main method

{

int i,c=0;//defining integer variable

for (i=100;i<=1000;i++)//defining a loop that counts number from 100 to 1000

{

   if(i%6==0 && i%5==0)//defining an if block that checks number is divisible by 5 and 6  

   {

       printf("%d ", i);//print value  

       c++;//incrementing the value of c

       if (c == 10)//defining an if block that check c value that is equal to 10

       {

          printf("\n");//print 10 rows

           c = 0;//holding value in c

       }    

   }

}    

return 0;

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/18308681

Ver imagen codiepienagoya
ACCESS MORE
EDU ACCESS