Write a program to check if a number is odd or even. on 11/27/2021 Get link Facebook X Pinterest Email Other Apps Q. Write a program to check if a number is odd or even.Code:-Method - 1num = float(input("Enter a number:"))if (num % 2) == 0: print("The number is even.")else: print("The number is odd.")Method - 2num = float(input("Enter a number:"))if (num % 2) != 0: print("The number is odd.")else: print("The number is even.")Output:- Comments
Comments
Post a Comment