What would be the value of bonus after the following statements are executed?
int bonus, sales = 85000;
char dept = 'S';
if (sales > 100000)
if (dept == 'R') bonus = 2000;
else bonus = 1500;
else if (sales > 75000)
if (dept == 'R') bonus = 1250;
else bonus = 1000;
else bonus = 0;

Respuesta :

Answer:

1000

Explanation:

first it will check for outer if (if (sales > 100000) ) as it is false it will go to else if(else if (sales > 75000) ) part. as this condition true, it will check dept and if(dept=='R') is false corresponding else part will be executed .