need help with completing this calculator C++

My calculator works in LXterminal but it needs something to add in it. They said WHILE YOU DIVIDE if the 2nd number is 0, it should say "Sorry you can't divide by zero" (It should only do that when CHOICE is QUOTIENT) I don't know where to add it in this codes HELP

if (choice == quotient)
{
cout << "The quotient is: " << first_number/second_number << "\n";
}

return 0;
}
[/code]
Last edited on
It should only do that when CHOICE is QUOTIENT

I do not understand what is confusing there? Would it not make sense that you would add it after
if (choice == quotient)

Then just nest another if/else like
1
2
3
4
if(second_number == 0)
    cout << "Sorry you can't divide by zero";
else
    // go ahead 
i think you are confusing about the QUOTIENT ^^
Topic archived. No new replies allowed.