write a python program to determine whether a given number
is even or odd respectly
please answer my question guys
Answers
Answered by
9
Answer:
Python Program to Check if a Number is Odd or Even
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even number". format(num))
else:
print("{0} is Odd number". format(num))
Answered by
50
Required Answer :
Appropriate Question:
- Write a python program to determine whether a given number is even or odd respectively.
Program:
def check(n):
if (n < 2):
return (n % 2 == 0)
return (check(n - 2))
n=int(input("Enter number:"))
if(check(n)==True):
print("Number is even!")
else:
print("Number is odd!")
Output:
The output will be as follows:
Case 1:
Enter number:124
Number is even!
Case 2:
Enter number:567
Number is odd!
Similar questions
Biology,
29 days ago
Social Sciences,
29 days ago
English,
29 days ago
Physics,
8 months ago
India Languages,
8 months ago