public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int aman = num;
int ans = 0;
while (num != 0) {
int rem = num % 10;
ans = ans + (rem * rem * rem);
num = num / 10;
}
if (ans == aman) {
System.out.println("true");
} else
System.out.println("false");
}
Here is my Armstrong number.Out of 7 I am able to pass only 5 test cases.please clarify my doubt what changes my code required.