0

How to generate random number in Free Pascal between 1 and 1,000,000?

I have used a variable type as LongInt, Real, Integer, but there is always an RangeError.

But random number between 1 and 33,333 is working correctly.

Program Random;

var
  a: ...;

begin

a:=random(1000000);

end.
2
Contributors
1
Reply
40
Views
3 Years
Discussion Span
Last Post by cereal
This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.