I did it like this:

#include

using namespace std;

int main()
{
constexpr int Word_Length = 5;
int X = Word_Length;
cout << “Welcome to the Bulls and Cows game!\n”;
cout << "Can you guess the “<< X << " letter isogram I’m thinking of?\n”;
return 0;
}

Cool!, it works.

but as you may expect the code will get bigger and bigger within time, so it’s wise to always set a variable with a good description of his purpose.

Privacy & Terms