C / about salary

0

C

목록 보기
3/3
#include <stdio.h>

int main() {
   const double PAY_INCREASE = 0.076;
   double salary, retroactive_pay, new_salary, new_monthly_salary;

   while (1) {
      printf("Enter current annual salary (enter 0 to stop): ");
      scanf("%lf", &salary);

      if (salary == 0) {
         break;
      }

      retroactive_pay = (salary * PAY_INCREASE) / 2;
      new_salary = salary * (1 + PAY_INCREASE);
      new_monthly_salary = new_salary / 12;

      printf("New annual salary: %.2lf\n", new_salary);
      printf("New monthly salary: %.2lf\n", new_monthly_salary);
      printf("Retroactive pay due: %.2lf\n", retroactive_pay);
   }

   return 0;
}
profile
𝐁𝐚𝐜𝐤-𝐞𝐧𝐝 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 (𝐒𝐖)

0개의 댓글