In the Arithmetic Expressions module we talked about the features of the division operation in C#.
Recall that for integer data (type int) two division operations can be used.
/ - integer division, when the fractional part is discarded as a result of the division operation.
% - calculation of the remainder of the division.
Example:
int a, b;
a = 10;
b=3;
int c = a / b; // Answer: c = 3
int d = a % b; // Answer: d = 1
These operations are very important in programming. They need to be understood and used correctly.