armstrong number
import java.util.Scanner;
class Mittu
{
public static void main(String []args)
{
Scanner s=new Scanner(System.in);
int n,x,y,z,t;
System.out.println("enter any three digit number");
n=s.nextInt();
t=n;
x=n/100;
n=n%100;
y=n/10;
n=n%10;
z=n/1;
n=n%1;
z=x*x*x+y*y*y+z*z*z;
System.out.println(z);
if(t==z)
System.out.println("it is armstrong number");
else
System.out.println("it is not armstrong number");
}
}
output
enter any three digit number407
407
it is armstrong number