I am trying to use the rand()
which can generate a random number. However, I found that the code keep giving the same number when every time I compile it.
Here is the code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int a = rand() % 11;
cout << a;
return 0;
}