Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C <- this indicates a comment if it is in the first column
- C begin the actual code
- program enter_number
- implicit none
- C make some integers i and j
- integer :: i, j
- C makes a pointerish object
- real, dimension(:), allocatable :: waste_of_space
- C Just spinning its wheels
- j=0
- do while (j < 100000)
- j=j+1
- end do
- C getting some memory for no reason
- allocate (waste_of_space(100000000))
- C output to console window
- write (*,*) "Enter a number: "
- C reads in from console
- read (*,*) i
- C fancy if checks
- if (i > 100) write (*,*) "Wow, that's a big number."
- if (i < 100) write (*,*) "Good job, you entered a number."
- if (i == 100) write (*,*) "It's a secret to nobody since 1987."
- C we dont want memory leaks
- deallocate (waste_of_space)
- C ending of code
- end program enter_number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement