Translate

Labels

Saturday 27 April 2013

SUM THE FIRST 50 EVEN NATURAL NUMBERS

/*PROGRAM TO SUM THE FIRST 50 EVEN NATURAL NUMBERS*/
#include<stdio.h>
main()
{
int sum=0,i=2;
while(i<=100)
{
sum+i;
i+=2;
}
printf("Sum of first 50 even natural numbers=%d\n",sum);
getch();
}

OUTPUT
Sum of first 50 natural numbers=2550


No comments: