[ create a new paste ] login | about

Link: http://codepad.org/vJ5qcZq9    [ raw code | output | fork ]

C, pasted on Jul 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

int i;
int j = 0;
int sum;

int main() {
    for (i = 0; i < 101; i++)
    {
        j = j + i * i;
        }
        
        printf("The sum of squares is %d", j) ;
        return 0;
        }


Output:
1
The sum of squares is 338350


Create a new paste based on this one


Comments: