operators_concatenate1.ijm 420 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
// initialize program
n1 = 3;
n2 = 2.5;
n3 = 4;

// compute sum and meam
sum = n1 + n2 + n3;
mean = sum / 3; 

// use '+' to concatenate and print nice results
// observe the difference in output with and without spacing 
print("Input numbers = " + n1 + ", " + n2 + ", " + n3);

print("Without spacing:");
print("sum=" + sum);
print("mean=" + mean)

print("With spacing:")
print("sum = " + sum);
print("mean = " + mean)