What is wrong in this code?

package challanges;

import java.util.Scanner;

public class armstrongno {

public static void main(String[] args) {
	Scanner scn=new Scanner(System.in);
	int n=scn.nextInt();
	  int c=0,a,temp;  
	    
	    temp=n;  
	    while(n>0)  
	    {  
	    a=n%10;  
	    n=n/10;  
	    c=c+(a*a*a);  
	    }  
	    if(temp==c)  {
	    System.out.println("true"); 
	    }
	    else {  
	        System.out.println("false");   
	   }  
		
		
	
	
	
}

}

@harsh.hj reviewing it buddy!

@harsh.hj bro carefully read this definition “A positive integer of n digits is called an Armstrong number of order n (order is number of digits) if.”

now check for 1634 , 4 digits and for every number you are considering digit ^ 3. the power is the number of digits as mentioned in problem.

If your query is resolved then close the doubt by marking it resolved and rate full bro!

so how can i do it ??? do i have to introduce Math.pow???

public static void main(String[] args) { Scanner scn=new Scanner(System.in); int N=scn.nextInt(); double c=0; int a,temp,n=0; temp=N; while(N>0) { a=N%10; if (a>=0) { n=n+1; } N=N/10; c=c+ Math.pow(a , n ); } if(temp==c) { System.out.println(“true”); } else { System.out.println(“false”); } }