[ create a new paste ] login | about

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

C++, pasted on Aug 8:
1
2
3
4
5
6
7
8
9
10
11
12
    void sum() {
       int sum = 0;
       for (int i = 0; i <= 10; i++) {
          sum += i;
       }
       cout << sum << endl;
    }


int main() {
  sum();
}


Output:
1
55


Create a new paste based on this one


Comments: