+ 1

Plz check it is true reply me its a program on salary if grade is above on 15. Bonus 50% on salary wil also provide if

#include <iostream> using namespace std; int main() { float salary, bonus; int grade; cin>>salary; cin>>grade; if (grade>15) bonus =salary*50/100; else bonus =salary*50/100; int tsalary =bonus+salary; cout <<"salary in Rs.">>tsalary; return 0; }

13th Aug 2017, 8:48 AM
Aamir Shehzad
Aamir Shehzad - avatar
5 odpowiedzi
+ 2
1.declare tsalary first then use it 2.in last cout use this symbol << insted of >> this symbol and here if your condition is true then you provide 50% bonus but in else also you provide same bonus so provide 50% only once and 3.you required to use simple if instead of if else
13th Aug 2017, 8:57 AM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 1
Thanks bro
13th Aug 2017, 9:06 AM
Aamir Shehzad
Aamir Shehzad - avatar
+ 1
Thanks again bro my program has completed i run it..its ok now
13th Aug 2017, 9:10 AM
Aamir Shehzad
Aamir Shehzad - avatar
0
nice
13th Aug 2017, 9:15 AM
Mayur Chaudhari
Mayur Chaudhari - avatar
0
where are you from sir? ?
13th Aug 2017, 1:29 PM
Aamir Shehzad
Aamir Shehzad - avatar