Need help on creating a method.
I need help on creating a method that calculates the Greatest Common Divisor of two numbersx andy, then returns the greatest common divisord. So, I created this...
publicstatic _gcd (long x,long y){
int j = 1;
do{// loops to find the GCF
long[] mod_num_array;
mod_num_array[0] = y % x;
mod_num_array[j] = mod_num_array[j - 1] % x;
j++;
}while (mod_num_array[j] != 0);
return mod_num_array[j];// returns [b][i]d[/i][/b]
}
When I try to compile the method, i get an error saying thatreturn mod_num_array[j];// returns [b][i]d[/i][/b]
is missing the array start, when i put thelong[] mod_num_array;
outside the do-while, it says that mod_num_array[0] = y % x;
is missind the array start. So im lost, can someone please help. In advance, thanks for the effort.

