source:
CIVL/doc/manual/sumlib/sumlib_test.c@
cc8e265
| Last change on this file since cc8e265 was 0724e5d, checked in by , 7 years ago | |
|---|---|
|
|
| File size: 183 bytes | |
| Rev | Line | |
|---|---|---|
| [0724e5d] | 1 | #include <stdio.h> |
| 2 | #include <assert.h> | |
| 3 | #include "sumlib.h" | |
| 4 | #define N 100 | |
| 5 | int main() { | |
| 6 | int result = sum(N); | |
| 7 | printf("N=%d, sum = %d\n", N, result); | |
| 8 | assert(result == (N+1)*N/2); | |
| 9 | } |
Note:
See TracBrowser
for help on using the repository browser.
