source:
CIVL/mods/dev.civl.com/doc/manual/sumlib/sumlib.c@
1aaefd4
| Last change on this file since 1aaefd4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 114 bytes | |
| Rev | Line | |
|---|---|---|
| [0724e5d] | 1 | #include "sumlib.h" |
| 2 | int sum(int n) { | |
| 3 | int result = 0; | |
| 4 | for (int i=1; i<=n; i++) result += i; | |
| 5 | return result; | |
| 6 | } |
Note:
See TracBrowser
for help on using the repository browser.
