fork download
  1. PROGRAM Arithmetic
  2. !-------------------------------------------------------------------------------
  3. !Karl Harris ENGR225 January-20-2012
  4. ! ASSIGNMENT #1
  5. !
  6. !Program to add two real numbers. Variables used are:
  7. ! X,Y : the two real numbers
  8. ! Sum : the sum of X and Y
  9. !
  10. !Output : X, Y, and Sum
  11. !-------------------------------------------------------------------------------
  12.  
  13. IMPLICIT NONE
  14. Real :: X, Y, Sum
  15.  
  16. X = 3.14
  17. Y = 2.057
  18. Sum = X+Y
  19. Write(*,*) "Sum of", X, "and", Y, "is", Sum
  20.  
  21. END PROGRAM Arithmetic
  22.  
Success #stdin #stdout 0.01s 2620KB
stdin
Standard input is empty
stdout
 Sum of   3.1400001     and   2.0569999     is   5.1970000