My program asks a user for two numbers, and then I have to pass those numbers to my function. My function is supposed to "Identify the greatest common divisor (GCD) of the two values using Euclid's Algorithm. Return true if this value is greater than 1 and less than the smaller of the two numbers. Set the call-by-reference parameter to the value of the GCD. In main() output the GCD and whether or not your function returned true or false." How do I do this?
int gcd (int a, int b)
{
int c;
if ( b == 0 )
return a;
else
while ( b != 0 )
{
c = b;
b = a % b;
a = c;
}
return a;
}