write the java program to check the number is even or odd using if ..else
Answers
Answered by
0
Answer:
The entered number is then stored in a variable num . Now, to check whether num is even or odd, we calculate its remainder using % operator and check if it is divisible by 2 or not. For this, we use if...else statement in Java. If num is divisible by 2 , we print num is even.
Similar questions