#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,sum=0;
clrscr();
while(i<=100)
{
if(i%4==0)
{
sum=sum+i;
}
i++;
}
printf("sum of all numbers from 0-100 i.e. devisible by 4==>%d",sum);
getch();
}
/************************** OUTPUT WINDOW ************************/
sum of all numbers from 0-100 i.e. devisible by 4==>1300
No comments:
Post a Comment