SE 3800: gcd.c

Description

The Greatest Common Divisor program (gcd.c) calculates and prints the largest integer which divides two other integers.

Input Format

Two integer arguments are given when the command is invoked. Both must be greater than zero. For example, type
        % gcd 3 21

Output Format

Output is a single sentence printed on the screen such as
        The gcd of 3 and 21 is 7.

Operational Considerations

There are no special operational conditions. However, errors should be reported for numbers that do not satisfy the above constraint and for specifying too few arguments.

Executable

Windows executable: gcd_exe. Rename this to "gcd.exe" after downloading.