*--------_--------_---------_---------_---------_---------_---------_--
* Greatest Common Divisor Program in FORTRAN 77  
*
 10   FORMAT ('1', A46 // 'Enter two integers, 6 columns each: ' )
 20   FORMAT ( 2 I6)
 30   FORMAT ('0', A11, I6, A5, I6, A3, I6)
*
      PRINT 10, 'Greatest Common Divisor in FORTRAN 77'
      READ 20, J, K 
* Save J and K for later output.
      J2 = J
      K2 = K 
*
* If K is larger, then swap the inputs.
      IF (J .GT. K)  GO TO 200
      L = J
      J = K
      K = L 
* Main computation loop; M is modulus (remainder).  
 200  M = MOD(J, K)
      IF (M .EQ. 0) GO TO 300
      J = K  
      K = M 
      GO TO 200
*
* Done with computation; print the answer.
 300  PRINT 30, 'The GCD of', J2, ' and ', K2, ' = ', K
      END
 	
