Answers for "check if a given number is an armstrong or not in java 8"

2

armstrong number in java

int c=0,a,temp;  
    int n=153;//It is the number to check armstrong  
    temp=n;  
    while(n>0)  
    {  
    a=n%10;  
    n=n/10;  
    c=c+(a*a*a);  
    }  
    if(temp==c)  
    System.out.println("armstrong number");   
    else  
        System.out.println("Not armstrong number");
Posted by: Guest on March-11-2020

Code answers related to "check if a given number is an armstrong or not in java 8"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language