source: CIVL/mods/dev.civl.abc/examples/c/simple.c

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 538 bytes
Line 
1#include<stdio.h>
2int x = 1;
3int y = 0;
4int a[3];
5int b[5][5];
6
7int main() {
8 printf("%d\n", x);
9 int z;
10/*
11 //Part 2: Array
12 x = 7;
13 a[0] = 1;
14 a[1] = 6;
15
16 x = x * 2;
17 a[2] = 3;
18 x = x - 2;
19 b[4][4] = 10;
20 b[4][2] = 13;
21 b[a[1]][a[2]] = 15;
22 b[a[1]][2] = 2*a[a[a[0]]];
23*/
24
25// x = 1;
26// y = 2;
27
28 //Part 3: If condition
29// if(x > y + 2)
30// z = 1;
31// else
32// z = 2;
33 a[0] = 1;
34 a[1] = 5;
35
36 b[1][1] = 2;
37 b[a[1]][2] = 4;
38
39 if (a[b[2][1]] > b[1][0] + 2)
40 z = 1;
41 else
42 z = 2;
43
44 x = 1;
45/*
46 for(int i = 0; i < 5; i++){
47 x = x + 1;
48 }
49*/
50}
Note: See TracBrowser for help on using the repository browser.