Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- float a, c, b = 0;
- printf("Enter salary: ");
- scanf("%f", &a);
- if(a>=1 && a<=400)
- {
- b = 12;
- }
- else if(a>=401 && a<=900)
- {
- b = 10;
- }
- else if(a>=901 && a<=1200)
- {
- b = 5;
- }
- else if(a >=1201)
- {
- b = 3;
- }
- if(b == 12 || b == 10 || b == 5 || b == 3)
- {
- c = (a * (b/100));
- a = a + c;
- printf("Your incremented salary is: %.2f\n",a);
- }
- else
- {
- printf("You entered a negative value\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement