|
From: Jesper <hag...@ho...> - 2001-02-13 20:40:39
|
//beginning of program
#include <iostream.h>
#include <stdlib.h>
int main()
{
int number;
number=3D1+rand()%13;
cout << number;
return 0;
}
//end of program
Try this it worked. One stupid thing is that it gives you the same =
number everytime you use it.I have forgotten how to do if you want =
diffrent numbers every time you use the program.
Anyone knows?
Jesper
----- Original Message -----=20
From: "Jose Flores" <jf...@ax...>
To: <dev...@li...>
Sent: Tuesday, February 13, 2001 5:58 PM
Subject: RE: [Dev-C++] Random Number
> I get and error " implicit declaration of function 'int =
random(....)' "
> when I tried the "number =3D random(13)+1;" command. Any suggestions?
>=20
> -----Original Message-----
> From: Jesper [mailto:hag...@ho...]
> Sent: Tuesday, February 13, 2001 11:29 AM
> To: dev...@li...
> Subject: Re: [Dev-C++] Random Number
>=20
>=20
> Try this it might work:
>=20
> number =3D random(13)+1;
>=20
> Jesper
>=20
> ----- Original Message -----=20
> From: "Jose Flores" <jf...@ax...>
> To: <dev...@li...>
> Sent: Tuesday, February 13, 2001 5:16 PM
> Subject: [Dev-C++] Random Number
>=20
>=20
> > what is a good simple command to get a random number from 1 to 13? =
I keep
> > getting the run around when I ask this question...
> > Thanks=20
> > Jose
> >=20
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >=20
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|