output problem?

hi. im having a problem with my program. i want to print the final score but if it is negative i want it to be 0 in the output. with this i get both the negative number and 0. how should i change it so that i only get 0. i tried putting the cout<<finalscore on the bottom of the if statement but that didnt work.

finalscore=(2*wins+ties-losses);
cout<<"the final team score is ";
cout<<finalscore;
if (finalscore<0)
cout<<"0";
1
2
3
4
5
6
7
cout << "Final score is ";
If (finalscore > 0)
{
    cout << finalscore << endl;
} else {
    cout << "0" << endl;
}
Last edited on
thank you. you are awesome :)
Topic archived. No new replies allowed.