[Solved] Computing the overtimepay is my formula correct?


Your calculation is alright (not that complicated after all!), I’d just suggest to change your condition statement to reduce a bit your code:

double hours, overtimepay, wage;
printf("Enter number of hours: ")
scanf("%f",&hours);

wage=9.73*hours;
wage = 9.73 * hours;

printf("Your wage is: %f\n",wage);

if(hours > 40)
{
   overtimepay = (9.73*(hours-40))*1.5;
   printf("Your overtime pay is: %f\n", overtimepay);
}

solved Computing the overtimepay is my formula correct?