Message-Id: <199907290807.EAA05343@delorie.com> From: "Dan Gold" To: Subject: Re: -- Random question -- Date: Wed, 27 Jan 1999 16:27:22 -0800 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Reply-To: djgpp AT delorie DOT com Use rand()%256 for number between 0 and 255. ---------- > From: Börje Granberg > To: djgpp AT delorie DOT com > Subject: -- Random question -- > Date: Saturday, July 24, 1999 10:29 AM > > I know there are commands like rand() and random() but how do I get a random > number between 1 and 100? > > In BASIC it is easy because there you get a random (float) number between 0 > and 1 that you can multiplicate with 100 and add 1, but I dont see that > opportunity in C++ or have my eyes missed that part? > > > -- > /Börje > > >