operators_add.ijm 428 Bytes
Newer Older
walker's avatar
walker committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// initialise program
// operator '=' is used to assign values to variables
n1 = 3;
n2 = 2.5;
n3 = 4;

// operator '+' can add values stored into variables
sum = n1 + n2 + n3;

// compute mean of the 3 numbers
mean = sum / 3; 

// show the results
print("Sum =")
print(sum);
print("Mean =")
print(mean)


// operator '+' can directly add values as well
sum_new = 4 + 5;

// show the results
print("New sum =");
print(sum_new);