fork(2) download
  1. program add
  2. c
  3. c John Mahaffy, Penn State University, CmpSc 201 Example
  4. c 1/26/96
  5. c
  6. c
  7. c This is a simple program to read 2 numbers and print the sum
  8. c
  9. implicit none
  10. real a,b,s
  11. c
  12. c a - one of two numbers to be added
  13. c b - the other number in the sum
  14. c s - the sum of a and b
  15. c
  16. c Get the numbers from the program user
  17. c First ask for the numbers
  18. c
  19. print *, ' This program adds 2 real numbers'
  20. print *, ' Type them in now separated by a comma or space'
  21. c
  22. c Now read the numbers that are typed by the user
  23. c this Fortran read will wait unil the numbers are typed
  24. c
  25. read *, a,b
  26. c
  27. c Now calculate the sum
  28. c
  29. s = a + b
  30. c
  31. c Print out the results with a description
  32. c
  33. print *, 'The sum of ', a,' and ' , b
  34. print *, ' is ' , s
  35. stop
  36. end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.f95:2:

c
1
Error: Unclassifiable statement at (1)
prog.f95:3:

c       John Mahaffy,  Penn State University, CmpSc 201 Example
1
Error: Unclassifiable statement at (1)
prog.f95:4:

c       1/26/96
1
Error: Unclassifiable statement at (1)
prog.f95:5:

c
1
Error: Unclassifiable statement at (1)
prog.f95:6:

c
1
Error: Unclassifiable statement at (1)
prog.f95:7:

c   This is a simple program to read 2 numbers and print the sum
1
Error: Unclassifiable statement at (1)
prog.f95:8:

c
1
Error: Unclassifiable statement at (1)
prog.f95:11:

c
1
Error: Unclassifiable statement at (1)
prog.f95:12:

c   a - one of two numbers to be added
1
Error: Unclassifiable statement at (1)
prog.f95:13:

c   b - the other number in the sum
1
Error: Unclassifiable statement at (1)
prog.f95:14:

c   s - the sum of a and b
1
Error: Unclassifiable statement at (1)
prog.f95:15:

c
1
Error: Unclassifiable statement at (1)
prog.f95:16:

c  Get the numbers from the program user
1
Error: Unclassifiable statement at (1)
prog.f95:17:

c  First ask for the numbers
1
Error: Unclassifiable statement at (1)
prog.f95:18:

c
1
Error: Unclassifiable statement at (1)
prog.f95:21:

c
1
Error: Unclassifiable statement at (1)
prog.f95:22:

c   Now read the numbers that are typed by the user
1
Error: Unclassifiable statement at (1)
prog.f95:23:

c   this Fortran read will wait unil the numbers are typed
1
Error: Unclassifiable statement at (1)
prog.f95:24:

c
1
Error: Unclassifiable statement at (1)
prog.f95:26:

c
1
Error: Unclassifiable statement at (1)
prog.f95:27:

c   Now calculate the sum
1
Error: Unclassifiable statement at (1)
prog.f95:28:

c
1
Error: Unclassifiable statement at (1)
prog.f95:30:

c
1
Error: Unclassifiable statement at (1)
prog.f95:31:

c   Print out the results with a description
1
Error: Unclassifiable statement at (1)
prog.f95:32:

c
1
Error: Unclassifiable statement at (1)
Fatal Error: Error count reached limit of 25.
stdout
Standard output is empty