Computer Science, asked by amit00145, 1 year ago

Write a program to input a number through the keyboard and then reverse the number and to print it.

Answers

Answered by paritosh34
2
import java.util.*;
class reverse {
public static void main (String a[]){
Scanner s=new Scanner (System.in);
System.out.println("Enter a number");
int r=s.nextInt();
int s=r%10;
int s2=r/10;
int s3=(s2*10)+s;
System.out.println("The reverse="+s3);
}}

paritosh34: Don't copy
Similar questions