Computer Science, asked by sarfraz709930asif, 8 months ago

write a program to check wether a number is odd or even​

Answers

Answered by swastikrout1973
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 anindyaadhikari13
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
Math, 11 months ago