Advertisement
Guest User

Untitled

a guest
Aug 29th, 2022
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     float a, c, b = 0;
  6.  
  7.     printf("Enter salary: ");
  8.     scanf("%f", &a);
  9.  
  10.     if(a>=1 && a<=400)
  11.     {
  12.         b = 12;
  13.     }
  14.     else if(a>=401 && a<=900)
  15.     {
  16.         b = 10;
  17.     }
  18.     else if(a>=901 && a<=1200)
  19.     {
  20.         b = 5;
  21.     }
  22.     else if(a >=1201)
  23.     {
  24.         b = 3;
  25.     }
  26.  
  27.  
  28.     if(b == 12 || b == 10 || b == 5 || b == 3)
  29.     {
  30.         c = (a * (b/100));
  31.         a = a + c;
  32.         printf("Your incremented salary is: %.2f\n",a);
  33.     }
  34.     else
  35.     {
  36.         printf("You entered a negative value\n");
  37.     }
  38.  
  39.  
  40.     return 0;
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement