Header Ads Widget

Python program to check whether a number is even or odd

 

  Python program to check whether a number is even or odd

Given a number , write a program to check whether number is even or odd .

Sample input 

8

Sample output

8 is even

Python program to check whether a number is even or odd

The objective of the code is check whether number is even or odd .

Code(Python):-

a=int(input())
if a%2==0:
print(f"{a} is even")
else:
print(f"{a} is odd")

Output:-

8
8 is even

Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-