Find all numbers between 100 and 200, divisible by 9
C program to find the number and sum of all integer numbers between 100 and 200, divisible by 9.
Program
#include<stdio.h>
#include<conio.h>
void main()
{
int i, sum=0;
printf("Numbers between 100 and 200, divisible by 9 : \n");
for(i=100;i<=200;i++)
{
if(i%9==0)
{
printf("%d, ",i);
sum = sum + i;
}
}
printf("\n\nSum : %d",sum);
getch();
}
Output
Numbers between 100 and 200, divisible by 9 :
108, 117, 126, 135, 144, 153, 162, 171, 180, 189, 198,
Sum : 1683