#include
int salary, years, bonus;void main(){clrscr();printf("enter salary:");scanf("%d", &salary);
printf("enter years of service:");scanf("%d", &years);
switch(years){
case 1: bonus= 0.10 * salary; printf("bonus:%d", bonus); break;
case 2: bonus= 0.20 * salary; printf("bonus:%d", bonus); break;
case 3: bonus= 0.20 * salary; printf("bonus:%d", bonus); break;
case 4: bonus= 0.20 * salary; printf("bonus:%d", bonus); break;
case 5: bonus= 0.20 * salary; printf("bonus:%d", bonus); break;
case 6: bonus= 0.50 * salary; printf("bonus:%d", bonus); break;
case 7: bonus= 0.50 * salary; printf("bonus:%d", bonus); break;
case 8: bonus= 0.50 * salary; printf("bonus:%d", bonus); break;
case 9: bonus= 0.50 * salary; printf("bonus:%d", bonus); break;
case 10: bonus= 0.50 * salary; printf("bonus:%d", bonus); break;}if (years>=11) bonus= 0.75 * salary; printf("bonus:%d", bonus);
getch();}
No comments:
Post a Comment