I need a program that generates a nxn matrix with random numbers, but they're not completely random. They must be delimited in -20,0 < x < 20,0, for example, but all i searched for the Random functions in pascal says that it produce numbers in a interval starting in zero...so, i would like to know how do i generate random numbers in a -n < x < n interval.
Jump to Post
If you don't want the same random numbers over and over again, at the very beginning of your program, call the randomize procedure.
begin randomize; // init number generator from system clock ... end.
As for the range, the problem is purely mathematical. If you have a …
All 4 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.