Q:

Reverse a given integer number using python programming

0

Reverse a given integer number

Given:

76542

Expected output:

24567

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

num = 76542
reverse_number = 0
print("Given Number ", num)
while num > 0:
    reminder = num % 10
    reverse_number = (reverse_number * 10) + reminder
    num = num // 10
print("Revere Number ", reverse_number)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now