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:(adsbygoogle = window.adsbygoogle || []).push({});

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 (Text):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

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran [Fortran] How to loss different random number

Loading...

Similar Threads for Fortran loss different |
---|

Fortran Successive Over Relaxation Method in FORTRAN |

If statement for Monte Carlo integration |

C/++/# How to use C++ in studying calculus |

Fortran How to buy Fortran Programming Software Commersial License |

Fortran Fortran for Computational Fluid Dynamics Problems |

**Physics Forums | Science Articles, Homework Help, Discussion**