Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class digitos{
- public static void main(String args[])throws IOException{
- BufferedReader in=new BufferedReader(new InputStreamReader (System.in));
- int n,ninv=0,a;
- System.out.print("ingrese numero: ");
- n= Integer.parseInt(in.readLine());
- do{
- a= (n%10);
- n=n/10;
- ninv = ninv*10+a;
- }
- while (n>0);
- System.out.println("el numero en orden inverso es : " +ninv);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement