Accept two digit number and reverse that
Ererise
Input 25
Output 52
Answers
Answered by
0
Answer:
import java.util.*;
public class Reverse
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int n,a,r=0;
System.out.println("Enter the number");
a=in.nextInt();
while(n!=0)
{
a=n%10;
r=r*10+a;
n=n/10;
}
System.out.println("The reversed number="+r);
}
}
Similar questions
English,
1 month ago
Social Sciences,
1 month ago
English,
4 months ago
Science,
10 months ago
Math,
10 months ago