does anyon know how to use the srand function? i have to generate a rndom number for a math prblem btwn 1..10 but i want them to be different everytime. i understand srand does this but i cat get it to work.


heres what i have

cout<<"generating random numbers between 1 and 10.....\n";


temp1 = tempA+double(rand())*((tempB-tempA)/RAND_MAX);
temp2 = tempA+double(rand())*((tempB-tempA)/RAND_MAX);

cout<<"\nThe first number is "<<temp1;
cout<<"\nThe second number is "<<temp2<<"\n";
cout<<"\nCan you figure out "<<temp1<<oper<<temp2<<" ?\n";
cin>>UserAns;
system("CLS");
return 0;