package day1;
public class Amstrong {
public static void main(String[] args) {
// TODO Auto-generated method stub
int no = 1634;
int no1 = no;
int armstrong = 0;
while(no>0)
{
int rem= no%10;
armstrong = armstrong + (rem*rem*rem*rem);
no = no/10;
}
System.out.println(armstrong);
if (armstrong == no1)
System.out.println("armstrong");
else
System.out.println("Not armstrong");
}
}
out put = 1634
armstrong
Top comments (0)