Write a program to input a number through the keyboard and then reverse the number and to print it.
Answers
Answered by
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);
}}
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
Hindi,
6 months ago
Hindi,
6 months ago
Physics,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago