On Thu, Mar 13, 2008 at 3:12 PM, fecress <[EMAIL PROTECTED]> wrote:
> Please help!!
>  How do I put this program output in an array?

First of all you don't output the return value of rand immediately,
instead you use a variable to store it, like:

int a = rand ();
cout << a << "\t";

And then you can put the same variable into the array (should be a
vector, since you use C++).

>  Do I have to create a file?

No.

>  Do I have to list all those 100 numbers generated into an array?

Well, not necessarily. What books or courses are you using? Didn't
they provide some hints about how to do this exercise?

>  Plaese help!
>
>  --- In [email protected], "Aswin Rajamannar" <[EMAIL PROTECTED]>
>  wrote:
>
>  >
>  > Store the random values in an array and find whatever u want with it
>  >
>  > On Wed, Mar 12, 2008 at 11:28 PM, fecress <[EMAIL PROTECTED]> wrote:
>  >
>  > > int main()
>  > > {
>  > > int how_many = 100;
>  > >
>  > > cout << "Print " << how_many << " random integers.\n";
>  > >
>  > > for (int i = 0; i < how_many; ++i)
>  > > cout << rand() << '\t';
>  > >
>  > > Please help me to add a code that determines average, maximum and
>  > > minimum values generated by the program above.
>  > >
>  > >
>  > >
>  >
>  >
>  > [Non-text portions of this message have been removed]
>  >
>
>  



-- 
Tamas Marki

Reply via email to