You are on page 1of 1

#include <stdio.

h>
#include <stdlib.h>
int main()
{
int hours;
float rate,salary;
while (hours>0){
printf("Enter # of hours worked (-1 to end): ");
scanf("%d",&hours);
if (hours==-1)
break;
printf("Enter hourly rate of the worker ($00.00): ");
scanf("%f",&rate);
if (hours>40)
salary=40*rate+(hours-40)*15;
else
salary=hours*rate;
printf("Salary is $%.2f\n",salary);
}
return 0;

You might also like