REAL FUNCTION LOG2 (A) C C This function computes the base two logarithm of A C IMPLICIT NONE REAL A LOG2 = LOG10(A)/LOG10(2.0) RETURN END PROGRAM USRDEF C C This program motivates the utility of user-defined functions C IMPLICIT NONE REAL LOG2 REAL X, Y, Z PRINT *, 'Please enter a real number' READ *, X PRINT *, 'The base two logarithm is ', LOG2(X) PRINT *, 'Please enter another real number' READ *, Y PRINT *, 'The base two logarithm is ', LOG2(Y) PRINT *, 'Please enter a third real number' READ *, Z PRINT *, 'The base two logarithm is ', LOG2(Z) STOP END