fork download
  1. PROGRAM arithmetic
  2. !------------------------------------------------------------------------------------------------------------
  3. ! George Austin Corbett III ENGR22 January 18, 2011
  4. ! Assignment #1
  5. !
  6. !
  7. ! Proram to add two real numbers. Variables used are:
  8. ! X, Y : The two real numbers
  9. ! Sum : The sum of X and Y
  10. !
  11. !
  12. ! Output: X, Y, and Sum
  13. !
  14. !--------------------------------------------------------------------------------------------------------------
  15. IMPLICIT NONE
  16. REAL :: X, Y, Sum
  17.  
  18. X = 3.14
  19. Y = 2.057
  20. Sum = X + Y
  21.  
  22. WRITE(*,*) "Sum of ", X, " and ", Y, " is", Sum
  23.  
  24. END PROGRAM arithmetic
  25.  
Success #stdin #stdout 0.02s 2620KB
stdin
Standard input is empty
stdout
 Sum of    3.1400001      and    2.0569999      is   5.1970000