HELP PLEASE!

Oct 17, 2013 at 2:20pm
the do-while loop does not get executed properly and the next output is printed..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
do
    {
    std::cout<<"\n Enter designation number : \n 1. Managing Director \n 2. Director \n 3. General Manager \n 4. Deputy General Manager \n 5. Chief Manager \n 6. Senior Executive \n 7. Executive \n 8. Officer \n 9. Clerk \n 10. Sub-Staff \n";
    std::cin>>no2;
    switch(no2)
    {
        case '1' : std::cout<<"MANAGING DIRECTOR";
                   sal=800000;
                   break;
        case '2' : std::cout<<"DIRECTOR";
                   sal=500000;
                   break;
        case '3' : std::cout<<"GENERAL MANAGER";
                   sal=300000;
                   break;
        case '4' : std::cout<<"DEPUTY GENERAL MANAGER";
                   sal=150000;
                   break;
        case '5' : std::cout<<"CHIEF MANAGER";
                   std::cout<<"\n Enter Pay:";
                   std::cin>>ba_sal;
                   if(ba_sal>100000||ba_sal<80000)
                   {
                       ba_sal=0;
                       std::cout<<"CHECK SALARY";
                   }
    }
    }while(ba_sal=0);
std::cout<<"\n Salary = Rs."<<sal;
}
Oct 17, 2013 at 2:21pm
On line 28:
}while(ba_sal==0);

= means assign
== means compare
Topic archived. No new replies allowed.