#include<stdio.h>
int main()
{
int i, sum, temp;
sum=0;
temp=1;
for( i=0; i<100; i++ )
{
sum = sum + temp;
temp = temp + 1;
}
printf("%d",sum);
return 0;
}
Output of the program:
5050
int main()
{
int i, sum, temp;
sum=0;
temp=1;
for( i=0; i<100; i++ )
{
sum = sum + temp;
temp = temp + 1;
}
printf("%d",sum);
return 0;
}
Output of the program:
5050
No comments:
Post a Comment