#include< stdio.h>
#include< conio.h>
int main()
{
long int i,sum=0;
clrscr();
for(i=1; ;i++)
{
if(i%2!=0)
sum=sum+i;
if(sum>500)
break;
}
printf("\nSum of the 1+3+5+---- until the sum>500 is : %ld",sum);
getch( );
return 0;
}
Tuesday, February 9, 2010
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete