TripleX code

#include

int main()

{

//print Welcome Message

std::cout << "So, whatsupp peep";

std::cout << std::endl;

std::cout << "Welcome to my game" << std::endl;

// Declare 3 Number Code

const int CodeA = 10;

const int CodeB = 5;

const int CodeC = 6;

const int CodeSum = CodeA + CodeB + CodeC;

const int CodeProduct = CodeA * CodeB * CodeC;

//Print sum and product on to the terminal

std::cout << std::endl;

std::cout << "+There are 3 numbers in the code" << std::endl;

std::cout << "+The code add-up to give:-" << CodeSum << std::endl;



std::cout << "+The codes multiply to give:-" << CodeProduct << std::endl;

//Getting users Input

int GuessA, GuessB, GuessC;

std::cin >> GuessA;

std::cin >> GuessB;

std::cin >> GuessC;



int GuessSum = GuessA + GuessB + GuessC;  

int GuessProduct = GuessA * GuessB * GuessC; 

if (GuessSum == CodeSum && GuessProduct == CodeProduct)

{

    std::cout << "You Win";

}

else

{

    std::cout << "I'm sorry you lose! Please retry";

}

return 0;

}

1 Like

I do the same game yesterday…
It’s not very nice to steal my game concept.

what do you mean i have not steal your game concept it was in the coarse

I tried to make a joke, indeed we all did the same lesson :upside_down_face:

Privacy & Terms