0
why it always give output 41 in try yourself box..???
2 ответов
+ 3
Please post the code next time so people know what you are talking about.
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
cout << rand();
}
The answer to your question lies in the next lessons: you have to use srand to initialize the seed. Placing srand(time(0)) before the call will fix your problem.
0
thnx Mr Zen....