Programming Concepts - Notes
Thursday, September 30, 2010
SUM 1 to 2o
#include <stdio.h>
main()
{
int i = 1;
int s = 0;
while(i <=20)
{
s = s + i;
printf("%d%s",i, "+");
i = i + 1;
}
printf("\n%s%d \n\n","SUM IS - ",s );
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment