Check whether a number entered by the user is even or odd.

Banu Prakash M
Guvi
Published in
1 min readAug 13, 2019

Problem 2 :

In this problem you will learn how to check whether a number entered by the user is even or odd. This problem is solved using if…else statement.

Steps :

Get the input from the user.

A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use the remainder operator % to compute the remainder. If the remainder is not zero, the number is odd.

Code Snippet for the above program :

guvi = int(input())if (guvi % 2) == 0:    print("Even")else:    print("Odd")

--

--