Maths in C++
Read · 1 of 5
Five operators
+ - * work as you'd expect. / divides, and % gives the remainder.
When both sides are whole numbers, / throws away the decimal part: 7 / 2 is 3. The remainder 7 % 2 is 1.
Read · 1 of 5
+ - * work as you'd expect. / divides, and % gives the remainder.
When both sides are whole numbers, / throws away the decimal part: 7 / 2 is 3. The remainder 7 % 2 is 1.