DEV Community

hema latha
hema latha

Posted on

Armstrong Number Program

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");

}
Enter fullscreen mode Exit fullscreen mode

}

out put = 1634
armstrong

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more