write a program of 5digit and is reverse:. eg.input:56789. output :98765
Answers
Answered by
0
Answer:
This program is written in Python language...
Explanation:
Number = int(input("Please Enter any Number: "))
Reverse = 0
while(Number > 0):
Reminder = Number %10
Reverse = (Reverse *10) + Reminder
Number = Number //10
print("\n Reverse of entered number is = %d" %Reverse)
Answered by
2
Question:-
➡ Write a program to input a 5 digit number and display it's reverse.
Program:-
➡ This is written in Java.
import java.util.*;
class Number
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter a 5 digit number: ");
int n=sc.nextInt();
int s=0;
while(n!=0)
{
s=s*10+n%10;
n/=10;
}
System.out.println("Reversed number is: "+s);
}
}
Similar questions
Geography,
4 months ago
Biology,
4 months ago
India Languages,
9 months ago
Social Sciences,
9 months ago
Physics,
1 year ago
Computer Science,
1 year ago