class ArmstrongNumber
{
public static void main(String args[])
{
int n, temp , r, s=0 ;
n=Integer.parseInt(args[0]);
temp = n;
while (temp != 0)
{
r = temp % 10;
s = s + (r * r * r);
temp = temp / 10;
}
if (n== s)
{
System.out.println(” It is an Armstrong Number”);
}
else
{
System.out.println(” It is not an Armstrong Number”);
}
}
}
- OUTPUT: