Source of Exercise23.cpp


  1: //  Created by Frank M. Carrano and Tim Henry.
  2: //  Copyright (c) 2013 __Pearson Education__. All rights reserved.

  4: int gcd(int a, int b)
  5: {
  6:    if (a % b == 0) // Base case
  7:       return b;
  8:    else
  9:       return gcd(b, a % b);
 10: }  // end gcd