### Problem with showing net salary

Pretty much trying to figure out the net salary but it wont show when i try to enter number..

Example: enter basic pay: 35050

net sal:

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243`` `````` #include using namespace std; int main() { float base, tax, net; cout << "enter basic pay"; cin >> base; if (base <= 19500) { net = base; } else if (base >= 19501 && base <= 28000) { net = (base - 19501)*0.2; } else if (base >= 28001 && base <= 36300) { net = (base - 28001)*0.25 + (28000 - 19500)*0.2 + 19500 * 0.0; } else if (base >= 36301) { net = (base - 28001)*0.30 + (28000 - 19500)*0.2 + 19500 * 0.0; } cout << "net sal: " << endl; cin >> net; return 0; system("pause"); }``````
Last edited on
I am assuming the variable `net` is the net salary. If so, then line 33 should be something like `cout << net;`
When I am looking at your code, line 33 is asking for the user to input (cin) the net.
Topic archived. No new replies allowed.