Exer7
#include#include
int salary,years,bonus;
int salary,years,bonus;
void main(){
clrscr();
printf("Enter salary:\n");
scanf("%d",&salary);
printf("Enter years of service:\n");
scanf("%d",&years);bonus=0;if (years==1){bonus=salary*0.10;printf("Bonus:%d",bonus);}
else if((years<=5)&&(years>=2)){bonus=salary*0.20;printf("Bonus:%d",bonus);}
else if((years<=10&&(years>=6))){bonus=salary*0.50;printf("Bonus:%d",bonus);}
else if((years<=11)){bonus=salary*0.75;printf("Bonus:%d",bonus);}
getch();
}
No comments:
Post a Comment