The declarations shown below are used for the following examples:
int i = 10, j = 3, n;
double x = 2.0, y;
This statement uses the multiplication operator:
In this case, x is multiplied by i to give the value 20.0. The result has double type.
In this example, 10 is divided by 3. The result is truncated toward 0, yielding the integer value 3.
This statement assigns n the integer remainder, 1, when 10 is divided by 3.
Microsoft Specific
The sign of the remainder is the same as the sign of the dividend. For example:
In each case, 50 and 2 have the same sign.
END Microsoft Specific