0
hey guys how to use random function in this app and is its header file <cstdlib> ??
one example please !!
1 Resposta
+ 2
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void) {
srand(time(0)); //initialize the seed
cout << rand() % 2; //gives 0 or 1 at random
return 0;
}