Why did we do this < // print the guess back to them in the play game function>

hello, i have a query as to why did we pasted this code
// print the guess back to them
cout << "Your guess was: " << Guess << endl;
cout << endl;

in the play game function?

and not let it stay in the get guess.

Because you only want a function to do one thing.
If you leave it in the GetGuess function, that function is doing two things -
getting the guess from the user and prints it back to them.

Privacy & Terms