C/C++ Arena

Step 3 of 6

And, or, not

Combine conditions with logical operators:

if (money >= 2700 && !has_rifle) { ... }

In C, any non-zero number counts as true and 0 is false.

Your turn: read money and round (two ints). A player can buy if they have at least 2700 money and it is not the first round (round 1 is a pistol round). Print buy or save.

Previous: else if chains Next: switch