But I gave you a way to do it in a single line.. more important, in a single statement:
cout << 6 + (rand() % 5) * 4;
Printable View
But I gave you a way to do it in a single line.. more important, in a single statement:
cout << 6 + (rand() % 5) * 4;
:) but my code will work for any 5 numbers.Quote:
Originally posted by PaulWendt
That's two lines, though.
Perhaps ... but it's beyond the realm of the OP's question.Quote:
Originally posted by mwilliamson
:) but my code will work for any 5 numbers.
It's quite irrelevant anyway, I suppose, since it was only an
academic question.