Can you tell me why followin code gives me an error

import java.util.*;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner (System.in);
int number = sc.nextInt();
int originalNumber, remainder, result = 0;

    originalNumber = number;

    while (originalNumber != 0)
    {
        remainder = originalNumber % 10;
        result += Math.pow(remainder, 3);
        originalNumber /= 10;
    }
	if(result == number)
		System.out.println("true");
	else
		System.out.println("false");

}

}

@chimurkarswaraj_6a2efadf61947f2f You didn’t understand the question correctly. You should take the power of every digit = length of the whole number. if the number is : 1234 then you should check : 1^4 + 2^4 + 3^4 + 4^4 not by using power = 3. another example : 56 here you should check : (length of whole number = 2) 5^2 + 6^2.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.