How do I use the MOD function in C \ C ++?
(N MOD 2) = 0
I have to use this line of my code.
How do I use the MOD function in C \ C ++?
(N MOD 2) = 0
I have to use this line of my code.
The MOD operator is %
.
int n = 40;
if (n % 2 == 0) {
cout << num << " é par";
}
Additionally see std::modulus