Spaces:
Sleeping
Sleeping
File size: 287 Bytes
e3486fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | // arithmetic.cl — Tests arithmetic expressions and operator precedence
int a;
int b;
int c;
int result;
a = 10;
b = 3;
c = 2;
// result = (a + b) * c - 1 → (10 + 3) * 2 - 1 = 25
result = (a + b) * c - 1;
// Test subtraction and multiplication separately
a = a - b;
b = b * c;
|