Program code
Output
The sum of all integers from one to 100 is 5050.
#include
<stdio.h>
#include
<conio.h>
void
main()
{
int i, sum=0;
clrscr();
for (i=1;i<=100;i++)
sum=sum+i;
printf(“The
sum of all integers from one to 100 is %d.\n”,sum);
getch();
}
The sum of all integers from one to 100 is 5050.
No comments:
Post a Comment
Please write here, your opinion about this C program