I didn't understand what everyone said here: srand(time(NULL)) doesn't change seed value quick enough and I am supposed to use the srand() to generate a different random number every time but I keep getting the same number, any suggestions?
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
int n, num;
cout<<"Enter the number:\n";
cout<<"n= "<<n<<endl;
cin>>num;
srand(time(NULL));
n= rand()%10+1;
if(n==num)
cout<<"win\n";
else
cout<<"lose\n";
return 0;
}