aboutsummaryrefslogtreecommitdiffstats
path: root/test/array.c
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-07-02 11:16:26 +0100
committerYann Herklotz <git@yannherklotz.com>2020-07-02 11:16:26 +0100
commit623869a9f902887f6634176ec88f30d27f638dec (patch)
tree2e624e0d1a38bcd7d952d3f1e575f5c1fd02a670 /test/array.c
parent4c475a386caeaee3e3ef7682840c738cecdee941 (diff)
parentaa28022035b16417aaafa36a450461c5133a44b4 (diff)
downloadvericert-kvx-623869a9f902887f6634176ec88f30d27f638dec.tar.gz
vericert-kvx-623869a9f902887f6634176ec88f30d27f638dec.zip
Merge branch 'dev-nadesh-merge' into dev-nadeshdev-nadesh
Diffstat (limited to 'test/array.c')
-rw-r--r--test/array.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/array.c b/test/array.c
index e33d47b..7d78a61 100644
--- a/test/array.c
+++ b/test/array.c
@@ -1,4 +1,7 @@
int main() {
- int x[5] = {1, 2, 3, 4, 5};
- return x[2];
+ int x[3] = {1, 2, 3};
+ int sum = 0, incr = 1;
+ for (int i = 0; i < 3; i=i+incr)
+ sum += x[i];
+ return sum;
}