#include<stdio.h>
#include<conio.h>
void main()
{
int odnum , sum=0; // odnum Stands for Odd Number
do
{
sum=sum+odnum; // It is also written as sum+=odnum
odnum=odnum+2; // It is also written as odnum+=2
}while(odnum<=50);
printf(" Sum=%d\n" , sum);
} /* End of main() */
Output:
Sum=625
0 comments:
Post a Comment