From: "Geoff J. Howard" Newsgroups: comp.os.msdos.djgpp Subject: rand() problem Date: Thu, 15 Jan 1998 13:02:57 -0600 Organization: University of Saskatchewan Lines: 29 Message-ID: NNTP-Posting-Host: duke.usask.ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hello All, I am just new to the djgpp world of C computing and I tried out a simple random number program and kept getting the same "random" number generated all the time, which is either 0 or no number. Is this a known problem? I have included the code below. I am thinking that it could be as a result of my computer not having enough RAM, what is the minimum amount I should have to run djgpp properly. Thanks all Geoff #include #include main () { int i; for (i=1; i<= 20; i++) { printf("%10d", 1 + (rand() % 6)); if (i % 5 == 0) printf("\n"); } return 0; }