Advertisement
Guest User

Untitled

a guest
Jun 14th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. C <- this indicates a comment if it is in the first column
  2. C begin the actual code
  3. program enter_number
  4.   implicit none
  5. C make some integers i and j
  6.   integer                         :: i, j
  7. C makes a pointerish object
  8.   real, dimension(:), allocatable :: waste_of_space
  9.  
  10. C Just spinning its wheels
  11.   j=0
  12.   do while (j < 100000)
  13.   j=j+1
  14.   end do
  15.  
  16. C getting some memory for no reason
  17.   allocate (waste_of_space(100000000))
  18.  
  19. C output to console window
  20.   write (*,*) "Enter a number: "
  21. C reads in from console
  22.   read (*,*) i
  23.  
  24. C fancy if checks
  25.   if (i > 100) write (*,*) "Wow, that's a big number."
  26.   if (i < 100) write (*,*) "Good job, you entered a number."
  27.   if (i == 100) write (*,*) "It's a secret to nobody since 1987."
  28.  
  29. C we dont want memory leaks
  30.   deallocate (waste_of_space)
  31. C ending of code
  32. end program enter_number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement