www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/25/18:00:46

Message-ID: <014401be8f68$2ce92440$ddf8c6c3@johans-dator>
From: "Johan Henriksson" <johan DOT he AT telia DOT com>
To: <djgpp AT delorie DOT com>
Subject: Re: Random
Date: Mon, 26 Apr 1999 00:03:57 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

from Johan Henriksson, Sweden    HTTP://come.to/jhewok  |
Primary mail: johan DOT he AT telia DOT com                  #UIN 12035895
Second: jhe75 AT hotmail DOT com    Third: johan_he AT yahoo DOT com
Leadprogrammer and FX-specialist at Real software
http://come.to/real_software
*************************************************************************
-----Original Message-----
From: Neil Edwards <neiled AT clara DOT net>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: Sunday, April 25, 1999 6:39 AM
Subject: Re: Random


>On Sat, 24 Apr 1999 17:23:50 +0200, "Anders Pedersen"
><anders_p AT forum DOT dk> wrote:
>
>>Will somebody please show me how to get an random number between a and b?
>>
> rand() % b
>
>so it can be modified to put limits on it
>
>i.e. from 50 - 100
>
>rand() % 50 + 50
>
>so if its number is 50 then 50 + 50 is 100
>if its 2 then 50 + 2 is 52, you get the idea!

Haven't done this stuff in Qb? right. This works better: (rand() % 50) + 50


>
>- Neil Edwards
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019