python program
Write a program in python to check whether the given number is odd or even ?
Program to check whether the given number is odd or even.
As we know that An integer value that can divided exactly by 2 is an even number. so that if a number is divided 2 then that no is even, else odd.
Steps of programming:-
- Get input from user.
- check that number is divisible by 2 or not.
- if number is divisible by 2 then print even else print odd
code:
x=input("Enter A Number")
y=x%2
if y==0:
print(x,"is an Even Number")
else:
print(x"is a Odd Number")
#DizIT_Operators
Thank-you
Thank-you
No comments:
Post a Comment