- #1
epratt
- 1
- 0
I'm trying to contruct a program that will generate a different random number between 1-10. I am not sure how to make it only 1-10.
PROGRAM guess
USE const
IMPLICIT NONE
INTEGER::i
REAL(kind=dp)::x
call random_number(x)
WRITE(*,*) 'x=',x
END DO
END PROGRAM guess
This gives me the same value every time of
Z:\CPS201>guess.exe
x= 3.920868194323862E-007
PROGRAM guess
USE const
IMPLICIT NONE
INTEGER::i
REAL(kind=dp)::x
call random_number(x)
WRITE(*,*) 'x=',x
END DO
END PROGRAM guess
This gives me the same value every time of
Z:\CPS201>guess.exe
x= 3.920868194323862E-007