For class I've made a turn based fighting game that keeps track of the user's health with:
Player.HP = 100;
cout << "Health: " << Player.HP << endl;
} while ((Player.HP >= 0) && (com.HP >= 0));
You can write the if statement with inline if:
cout << "Health: " << (Player.HP >= 0 ? Player.HP : 0) << endl;
Player.HP if it is greater or equal to zero, and prints zero otherwise.