returns the Greatest Common Divisor of two integers

What will be an ideal response?


```
int gcd( int num1, int num2 )
{
int divisor;
int dividend;
int remainder;
divisor = abs( num1 );
dividend = abs( num2 );
for ( remainder = dividend % divisor;
remainder != 0;
remainder = dividend % divisor ) {
dividend = divisor;
divisor = remainder;
}
return divisor;
}
```

Computer Science & Information Technology

You might also like to view...

Select the false statement. Depending on the compiler:

a. A failed new operation can return a 0. b. A failed new operation can throw a bad_alloc exception. c. A failed new operation can throw an exception if the header file has been included. d. A failed new operation can automatically be caught at compile time.

Computer Science & Information Technology

Create a new movie like the makeSunsetMovie method that turns the beach black after the blue and green is reduced by a passed amount.

What will be an ideal response?

Computer Science & Information Technology

Which of the following commands can you use to search available repository information? (Choose two.)

A. apt-cache B. apt-query C. apt query D. apt

Computer Science & Information Technology

A ____ error results when you use a syntactically correct statement but use the wrong one for the current context.

A. syntax B. logical C. semantic D. programming

Computer Science & Information Technology