aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/41_index_arithmetic_expr.sy
blob: 3ec6dbc2ffa49a4895577769f034336e477cd4bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Use arithmetic expression as array's index
int main() {
    int a;
    int b;
    int result[3];
    a = 56;
    b = 12;
    result[0] = 1;
    result[1] = 2;
    result[2] = 3;
    int t;
    t = result[(a % b + b) / 5 - 2];
    putint(t);
    return 0;
}