SHARE
TWEET

Untitled

a guest Oct 13th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int hrs=0;
  4. float rate=0, bonus=0, bsalary=0, tsalary=0;
  5.  
  6. main()
  7. {
  8.         clrscr();
  9.     printf("Input hours worked >> "); scanf("%d", &hrs);
  10.     printf("Input hourly rate  >> "); scanf("%f", &rate);
  11.  
  12.     if(hrs>45)
  13.         bonus=500;
  14.     else if((hrs>40) && (hrs<=45))
  15.         bonus=250;
  16.     else if((hrs>35) && (hrs<=40))
  17.         bonus=150;
  18.     else
  19.         bonus=0;
  20.  
  21.     bsalary=hrs*rate;
  22.     tsalary=bsalary+bonus;
  23.  
  24.     printf("Basic salary       >> P %.2f\n", bsalary);
  25.     printf("Bonus              >> P %.2f\n", bonus);
  26.     printf("Total salary       >> P %.2f\n", tsalary);
  27.  
  28.     getch();
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top