c-basic/sum.c

12 lines
173 B
C
Raw Normal View History

2022-11-24 21:04:54 +01:00
#include <stdio.h>
int main(){
int result = 0;
for (int i = 1; i < 101; i++){
result+=i;
}
printf("sum of 1 up to 100 is: %d\n", result);
return 0;
}