C program to print all the numbers and sum of all the integers that are greater than 100 and less than 200 and are divisible by 7


/* C program to print all the numbers and sum of all the integers that are greater than 100 and less than 200 and are divisible by 7. */


#include"stdio.h"

void main()
{
int i, k;
for(i=101; i<200; i++)
{
if(i % 7 == 0)
{

printf("%d ", i);
k = k + i;
}
}
printf("\nSum of the integers is: %d ", k);
printf("\n");

}

Output:



Comments

Popular Posts