Computer Science
Write a program to take a 2-digit number and then print the reversed number. That is, if the input given is 25, the program should print 52.
Python
Python Data Handling
92 Likes
Answer
x = int(input("Enter a two digit number: "))
y = x % 10 * 10 + x // 10
print("Reversed Number:", y)
Output
Enter a two digit number: 25
Reversed Number: 52
Answered By
46 Likes
Related Questions
Try writing program (similar to previous one) for three digit number i.e., if you input 123, the program should print 321.
Write a program to take year as input and check if it is a leap year or not.
Write a program to take two numbers and print if the first number is fully divisible by second number or not.
Write a program to take two inputs for day, month and then calculate which day of the year, the given date is. For simplicity, take 30 days for all months. For example, if you give input as: Day3, Month2 then it should print "Day of the year : 33".