fork download
  1. program DangerousMath
  2. implicit none
  3. integer, parameter :: dp = selected_real_kind(15)
  4. real(dp) :: A, B, x, mu, c
  5. integer:: I, K, n = 9
  6. character (10) :: Name
  7. a=3
  8. b=(n+3)/5
  9. x=5.75
  10. I=3.141959
  11. k=x/2.0
  12. mu=1./5.75
  13. write (*,*) "Please enter your name."
  14. read (*,*) Name
  15. write (*,*) "Hello", Name
  16. write (*,*)a,b,x,I,k,mu
  17. write (*,*) "Enter a value for A and B."
  18. read (*,*) A, B
  19. c = ((A +B)**2 - 2*a*b - B**2)/A**2
  20. write (*,*) c
  21. stop
  22. end program DangerousMath
Success #stdin #stdout 0.01s 2620KB
stdin
tat
2
2
stdout
 Please enter your name.
 Hellotat       
   3.0000000000000000        2.0000000000000000        5.7500000000000000                3           2  0.17391304671764374     
 Enter a value for A and B.
  1.00000000000000000