When we required evaluating basic mathematical expressions then we required to use asthmatic operators.
A= 2+5; 7 (return values)
A=5+3-4; 4
8-4
A= 5-4+3; 4
1+3
A= 2*3+2*3; 12
6+6
A= 2+3*2+3; 11
2+6+3
A=5+; Error
A= 8-; Error
A= +5; 5
A=-8; -8
Expression | Return Values |
---|---|
5/2 | 2 |
5.0/2 | 2.5 |
5/2.0 | 2.5 |
5.0/2.0 | 2.5 |
2/5 | 0 |
2.0/5 | 0.4 |
-5/2 | -2 |