Question: Write a program gcd that computes the greatest common divisor (GCD) of two integers. gcd takes two arguments, both integers, and prints the largest integer
Write a program gcd that computes the greatest common divisor (GCD) of two integers. gcd takes two arguments, both integers, and prints the largest integer that evenly divides both arguments.
Usage
$ ./gcd 12 20
4
$ ./gcd 1011 51
3
Notes You may assume that the arguments are positive integers that can be represented as (signed) int values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
