write a program to check wether a number is odd or even
Answers
Answered by
1
Here's the program in python:
num=int(input('Enter a number: '))
def isOddOrEven(num):
if num%2==0:
return f"{num} is an even number."
else:
return f"{num} is an odd number."
print(isOddOrEven(num))
Answered by
1
Question:-
- Write a program to check whether a number is odd or even.
Program:-
This is written in Python.
n=int(input("Enter a number: "))
if (n%2==0):
print("Number is even. ")
else:
print("Number is odd. ")
Similar questions