New course! Every coder should learn Generative AI!
Try a free lesson0
Make random choice
I'm trying to make that my c++ program choses randomly between 2 possible Outputs,can someone help me plese
1 Answer
0
#include <random>
#include <ctime>
srand(time(0));
x = 1+rand()%2; // random between 1 and 2