fork(2) download
  1. PROGRAM DANGEROUSMATH
  2. !---------------------------------------------------------------------------------
  3. !Karl Harris ENGR225 1-25-12
  4. !I predict the outcome to be "A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0
  5.  
  6. IMPLICIT NONE
  7. integer,parameter ::dp=selected_real_kind(15) !15 sig figs
  8. Real(dp) :: A,B, x, C, mu
  9. Integer :: I, K, n = 9
  10. Character(10) :: Name
  11. A=3
  12. B=(n+3)/5
  13. X=5.75d0
  14. I=3.1415959
  15. K=x/2.0
  16. mu=1./5.75
  17.  
  18. Write(*,*)"Please enter your name"
  19. Read(*,*) Name
  20.  
  21. Write(*,*) "Hello", Name
  22.  
  23. Write(*,*)" I predict the outcome to be A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0 "
  24. Write(*,*) a,b,x, I, k, mu
  25.  
  26. Write(*,*) "Enter a value for A & B"
  27. Read(*,*) A, B
  28. C=((A+B)**2-2*A*B-B**2)/A**2
  29. Write(*,*) C
  30. STOP
  31. END PROGRAM DANGEROUSMATH
  32.  
  33.  
Success #stdin #stdout 0.02s 2620KB
stdin
Karl
0.01 888.0
stdout
 Please enter your name
 HelloKarl      
  I predict the outcome to be A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0 
   3.0000000000000000        2.0000000000000000        5.7500000000000000                3           2  0.17391304671764374     
 Enter a value for A & B
   1.0000000003174137