Even Odd Number Program in Python


Any integer is input through the keyboard. Write a program to find out whether it is an odd number or even number. (Hint: Use the % (modulus) operator)

This program takes an input from the user, which is a number and assigns it to the variable "num". Then the program checks if the number is even or odd by using the modulus operator. If the remainder when the number is divided by 2 is equal to 0, the number is even, and the program prints that the entered number is an even number. If the remainder is not 0, then the number is odd, and the program prints that the entered number is an odd number.


Source Code

num = int(input("Enter the Number :"))
if(num%2==0):
	print(num,"is Even Number")
else:
 
	print(num,"is Odd Number")

Output

Enter the Number :34
34 is Even Number


Example Programs