Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Mon, 30 Apr 2001 13:37:42 EDT From: HRahman10 AT aol DOT com Subject: Random Number Generator To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Unknown (No Version) Message-ID: <32.143dcec3.281efce6@aol.com> Hi!, I'm writing a program using the random number genrator rand() defined in . I've written the following program to test it: void main() { int input1, i; srand(time(NULL)); for (i=0; i<20 ; i++) { input1 = rand() * 10 / (RAND_MAX + 1); printf("random numbers %i\n",input1); } } BUT, the results I get are all zeros. Is there something wrong with the gcc compiler provided by cygwin, because I've tested this program at university, and it outputs random numbers correctly. Please Help! Thank You! -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple