Tutorial#11 - Arithmetic Operators

Arithmetic Operators

Arithmetic Operators:

One of the most important uses of a computer is its ability to calculate. You can use the standard arithmetic operators to manipulate integral and floating-point data types.
There are five arithmetic operators:
1: + (addition)
2: - (subtraction or negation)
3: * (multiplication)
4: / (division)
5: % (mod, (modulus or remainder))
These operators work as follows:
You can use the operators +, -, *, and / with both integral and floating point data types. These operators work with integral and floating-point data the same way as you learned in a college algebra course.
1: When you use / with the integral data type, it gives the quotient in ordinary division. That is, integral division truncates any fractional part; there is no rounding.

2: You use % with only the integral data type, to find the remainder in ordinary division.

Source code download link: Click here to download....

Comments