Professional Documents
Culture Documents
2.1 Ips
2.1 Ips
2.1 Ips
7\11\22
Write a program to find sum of all integers greater than 100 & less than 200 and are divisible by 5.
#include <stdio.h>
int main()
{
int i=101,sum=0;
for(i;i<200;i++)
{
if (i%5==0)
sum += i;
}
printf("sum of the
series is %d",sum);
return 0;
}
No error
We take starting point and end point and use for loop to
start a loop from end point to end point if increment of 1
and use a conditional statement to make it print only if it is
divisible by 5