PROGRAM Births !-------------------------------------------------------- ! This program takes random numbers (generated uniformly ! between 0. and 1.) and assigns the sex of a child as ! either male (M) or female (F) according to a 50% ! probability for each case. !-------------------------------------------------------- IMPLICIT NONE INTEGER :: I CHARACTER(1) :: Sex REAL :: R DO I = 1, 6 CALL RANDOM_NUMBER(R) IF (R < 0.5) THEN Sex = "M" ELSE Sex = "F" END IF PRINT *, Sex END DO END PROGRAM Births