public class Reverse{
public static void main(String[] args){
int n=1234, rev=0;
while(n!=0){
int rem=n%10;
rev=rev*10+rem;
n=n/10;
}
System.out.println(rev);
}
}
Ouput:4321
}
Ouput:4321
Comments
Post a Comment