Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class p3
- {
- public static void main(String args[])
- {
- Scanner se=new Scanner(System.in);
- int a,b,temp,ans=0;
- System.out.println(" Enter the value: ");
- a=se.nextInt();
- temp=a;
- while(temp!=0)
- {
- b=temp%10;
- ans=(ans*10)+b;
- temp=temp/10;
- }
- System.out.println(a+" revers-> "+ans);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement