Screenshot

urc_s02_variables_and_cin_for_input

#include
#include

using namespace std;

int main()
{
// Introduce the game
constexpr int WORD_LENGTH = 5;
cout << “Welcome to Bulls and Cows, a fun word game.\n”;
cout << “Can you guess the " << WORD_LENGTH;
cout<<” letter isogram I am thinking of?\n";
//Get a guess from the player
string Guess = “”;
cin >> Guess;

//and repeat the guess back to the player
cout << "Your Guess was: " << Guess << endl;
return 0;

}

Privacy & Terms