+ 1
Please i need logic on how to to tell a user if the inputed number is an even number
logic
3 Answers
+ 2
if (a%2 == 0)..... It's even.
if (a%2 != 0).......it's odd.
it's using if statement in c++. Those are the text expressions.
+ 1
Like Suriya said. The % operator returns the remainder from division. If the remainder after dividing by 2 is zero, it is divisible by 2.