!!####################################################################
!! Gets 2 integers from user; prints the bigger number, and the
!! difference, which should be non-negative.
!!####################################################################
PROGRAM Difference
  IMPLICIT NONE

  INTEGER :: a, b  ! the 2 integers
  INTEGER :: big, diff

  ! Ask for first number
  WRITE (*,*) "Enter first integer:"
  READ (*,*) a

  ! Ask for second number
  WRITE (*,*) "Enter second integer:"
  READ (*,*) b

  IF (a > b) THEN
    big = a
    diff = a-b
  ELSE
    big = b
    diff = b-a
  END IF

  ! Print out results
  WRITE (*,*) "The bigger number is: ", big
  WRITE (*,*) "The difference is: ", diff

END PROGRAM Difference

