- #1
Galizius
- 14
- 0
Hello I am wondering how can I make sure that every number which I am losing will be different? I am using the following code:
I have set this seed for a purpose, because it gives two same values of the y. I would like to know how to carry out with this problem.
Code:
program lottery
implicit none
real(kind=4) :: x
real(kind=8) :: y
integer :: i, seed= 64256
call srand(seed)
do i=1,6
x=rand()
! to make the lossing interval [1,49]
y=ceiling(dble(x)*49.0d0)
write(*,*) y
enddo
end program lottery
I have set this seed for a purpose, because it gives two same values of the y. I would like to know how to carry out with this problem.