Skip to main content

Write a program to find the numbers and sum of all integers greater than 100 and less than 500 that are divisible by 9


Answer:

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();


int i,sum=0;
for(i=100;i<500;i++)
{
if(i%9==0)
sum=sum+i;
}
printf("\nSum=%d",sum);
getch();
}
Output:

            Sum: 13266