Question: else if (choice == 'c' ) { int num , tries= 0 ; num = rand() % 101 + 100 ; do { cout <

else if (choice == 'c')

{

int num, tries=0;

num = rand() % 101 + 100;

do

{

cout << "The computer's guess is " << num<< endl;

if (num < random)

{

cout << "Sorry, your guess is too low, try again! ";

num++;

}

if (num < random)

{

cout << "Sorry, your guess is too high, try again!";

num--;

}

}while (num != random);

}

}while (choice != 'q');

return 0;

}

How do i get the computer to randomize its guess?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!