source:
CIVL/examples/languageFeatures/add_seq.cvl@
38b7d06
| Last change on this file since 38b7d06 was dde38bf, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 214 bytes | |
| Line | |
|---|---|
| 1 | /* Compare sequential and parallel sum of array */ |
| 2 | #include<civlc.h> |
| 3 | $input int N; |
| 4 | $assume N>=0; |
| 5 | $input double a[N]; |
| 6 | double sum_seq; |
| 7 | |
| 8 | void main() { |
| 9 | sum_seq = 0.0; |
| 10 | for (int i=0; i<N; i++) |
| 11 | sum_seq += a[i]; |
| 12 | } |
Note:
See TracBrowser
for help on using the repository browser.
