write a program to input a number and check wheather it's last digit is even or odd using switch case
Answers
Answered by
1
Answer:
Logic to check even or odd number using switch... case
Input number from user. ...
Switch the even number checking expression i.e. switch(num % 2) .
The expression (num % 2) can have two possible values 0 and 1 . ...
For case 0 i.e. the even case print "Even number".
For case 1 i.e. the odd case print "Odd number".
Similar questions