1+2+3+...100 ?
int i, s;
for (i=1; i<=100; i++)
s=s+i;
printf("%d", s)
#include"stdio.h"
void main ()
{
int sum=0;
int i;
for (i=1;i<=100;i++)
sum+=i;
printf("sum=%d",sum);
}
1+2+3+...100 ?
int i, s=0;
for (i=1; i<=100; i++)
s=s+i;
printf("%d", s)