How to generate random number in FreePascal between 1 and 1,000,000
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
2 Hours
Discussion Span
2 Months Ago
Last Updated
37
Views
Related Article:May I ask you a question on Delphi?
is a solved Pascal and Delphi discussion thread by turbomen that has 4 replies and was last updated 8 months ago.