Ad Code

Responsive Advertisement

A PROGRAM TO CHECK IF A NUMBER ENTERED BY THE USER IS EVEN OR ODD.

A PROGRAM TO CHECK IF THE NUMBER ENTERED BY THE USER IS ODD OR EVEN-:

               



- First write the code to enter the number .

- Second use the If statement and put the condition that if the reminder is 0 on dividing the number by 2 .


-Third , then print the statement that the number is Even .


- Fourth , use the else statement which will work if [ if statement is not working ].



- Fifth, then print the number is odd.





To copy paste the code -:
n=int(input("Enter the number -:"))
if (n%2==0):
   print(n,"is Even")
else:
   print(n, "is Odd")

Post a Comment

0 Comments