I'm pretty new to programming. I found this interesting problem in Programming Praxis and got stuck at how to get the digits of an integer and storing them into an array.
I honestly do not know where to start and I'd like to learn how to do this in Java.
If you're interested, this is the code on the problem I'm working on.
public class MyClass {
public static void main(String args[]) {
// Determine all three-digit numbers N having the property that N is divisible by 11, and N/11 is equal to the sum of the squares of the digits of N.
int num = 100;
int square_sum = 0;
int digit1 = 0;
int digit2 = 0;
int digit3 = 0;
while (num <= 999){
if (num % 11 == 0) { //if remainder == 0; the number is divisible by 11//
// We need to get the digits of int "num" and square them //
int arrayDigits[] = new int[3];
} else
num++;
}
}
}