Enter the number from the user and depending on whether the number is even or odd, print out an appropriate message to the user.
Sample Solution:-
Python Code:
Sample Output:
Enter a number: 5 This is an odd number.
competitive programming guides eg.algorithms,problems,tricks ,datastructure based on cp.
Sample Solution:-
Python Code:
num = int(input("Enter a number: "))
mod = num % 2
if mod > 0:
print("This is an odd number.")
else:
print("This is an even number.")
Enter a number: 5 This is an odd number.
Are you ready to level up your web development game? Look no further than Next.js, the latest sensation in the world of web development th...
No comments:
Post a Comment