souce code: divisible7.c
#include<stdio.h>
void main()
{
int n,sum=0;
clrscr();
n=100;
printf(" numbers divisble by 7 from 100 to 200 : \n ");
while(n<200)
{
if(n%7==0)
{
printf(" %d ",n);
sum=sum+n;
}
n++;
}
printf(" \n sum =%d ",sum);
getch();
}
output:
0 Comments
Post a Comment