python program to check if a number is odd or even |
Python Program to Check if a Number is Odd or Even
python program to check if a number is odd or even |
programs -
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("Even number",num)
else:
print("Odd number",num)
if (num % 2) == 0:
print("Even number",num)
else:
print("Odd number",num)
output -
case 1
Enter a number: 22
Even number
case 2
Enter a number: 9
Odd number 9
Enter a number: 22
Even number
case 2
Enter a number: 9
Odd number 9
Post a Comment