From: Terence Ramos Newsgroups: comp.os.msdos.djgpp Subject: random numbers error in DJGPP Date: Sun, 02 Feb 1997 00:04:25 -0800 Organization: Netcom Lines: 13 Message-ID: <32F44A89.3142@ix.netcom.com> NNTP-Posting-Host: sjx-ca21-24.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hello... I have been having trouble to get DJGPP to give me random numbers. I am using the function rand()... this is how my source looks like number = rand() % 100 + 1; that should give me a random number from 1 to 100 right? well i keep on getting the same number which is 1. So i took out the + 1 part and now i only get 0. whats wrong here? Any help would be appreciated... [Terence Ramos ] [de-bug AT ix DOT netcom DOT com]