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.

## Recommended Answers

Jump to PostIf you don't want the same random numbers over and over again, at the very beginning of your program, call the

randomizeprocedure.`begin randomize; // init number generator from system clock ... end.`

As for the range, the problem is purely mathematical. If you have a …

## All 4 Replies

Duoas
1,025
Postaholic
Featured Poster

pukepuke
0
Newbie Poster

Duoas
1,025
Postaholic
Featured Poster

Artmann
0
Newbie Poster

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.