rogramme for take three digit number and print it in revere order
import java.util.Scanner;
class Mittu
{
public static void main(String []args)
{
Scanner s=new Scanner(System.in);
int n,x,y,z;
System.out.println("enter any three digit number");
n=s.nextInt();
x=n/100;
n=n%100;
y=n/10;
n=n%10;
z=n/1;
n=n%1;
System.out.println("number in reverse order");
System.out.print(z);
System.out.print(y);
System.out.print(x);
}
}
out put
enter any three digit number153
number in reverse order
351
No comments:
Post a Comment