Monday, May 12, 2014

Print and basic mathematical operations

Printing and basic mathematical operation:

Command print is use to print the result.

The first two commands are general print instructions for printing number. Print 54 has just printed only number 54.

Next three commands are used for printing the the resultant numbers after mathematical numbers.

"**" this command is used for power operation. 2**5 = 2^5 = 32
5**2 = 5^2 = 25

the next command is Division command here the resultant is always the greatest integer value [35/5] = 7
[32/6]=5
this is because the both operands are integers thus it will return an integer value.

last command (modular operator) is used here is remainder operator displaying the remainder of two operand.

No comments:

Post a Comment