Advertisement
apl-mhd

oishy

Jul 10th, 2021
1,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4.  
  5. int main()
  6. {
  7.  char gen;
  8.  int yos, sal, qual;
  9.  printf("Enter the gender of the employee. M for male and F for female:");
  10.  scanf(" %c",&gen);
  11.  printf("\nEnter the years of service of the employee: ");
  12.  scanf("%d", &yos);
  13.  printf("\nEnter the qualification of the employee. 0 for graduate and 1 for post-graduate: ");
  14.  scanf("%d", &qual);
  15.  printf("\n\n");
  16.  
  17.  
  18.     if (gen == 'M') {
  19.  
  20.         if (qual == 1) {
  21.             if (yos >= 10) {
  22.                 sal = 15000;
  23.             } else {
  24.                 sal = 10000;
  25.             }
  26.  
  27.         } else {
  28.  
  29.             if (yos < 10) {
  30.                 sal = 10000;
  31.             } else {
  32.                 sal = 7000;
  33.             }
  34.  
  35.         }
  36.     }
  37.     else{
  38.  
  39.         if (qual == 1) {
  40.             if (yos >= 10) {
  41.                 sal = 12000;
  42.             } else {
  43.                 sal = 9000;
  44.             }
  45.  
  46.         } else {
  47.  
  48.             if (yos < 10) {
  49.                 sal = 10000;
  50.             } else {
  51.                 sal = 6000;
  52.             }
  53.  
  54.         }
  55.     }
  56.  
  57.     printf("Salary is %d\n\n", sal);
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement