Skip to main content

Sum of even numbers between 1 to 50

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,evsum=0;
for(i=1;i<=50;i++)
{
if(i%2==0)
evsum+=i;
}
printf("%d\n",i);
getch();
}

Comments

Popular posts from this blog