Hello, good evening I would like to learn how to make a program differentiate odd even numbers.
I have to learn about what?
Hello, good evening I would like to learn how to make a program differentiate odd even numbers.
I have to learn about what?
You need to use an operator called a module, because it will do the division of the number, and it will return the rest to you, that way if a number divided by 2 returns zero, it will be even otherwise it will be odd.
example:
4 % 2 == 0
return of this operation will be 0 or the number is even
5 % 2 == 0
in this case the return will be 1 or the number is odd