Here we are writing a program to find whether a given number is even or odd.
PROGRAM
----------------------------------------------
num = int(input("Enter a number: "))
mod = num % 2
if mod > 0:
print("This is an odd number.")
else:
print("This is an even number.")
----------------------------------------------
RESULTS :
Enter a number: 5
This is an odd number.
No comments:
Post a Comment