Computer Science, asked by ertugrulcreation786, 4 months ago

Accept two digit number and reverse that
Ererise
Input 25
Output 52

Answers

Answered by kamalrajatjoshi94
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