....here is a short 25 liner which will do the job neatly......
Code:
#include <stdio.h>
int main()
{
float salary, rate;
int hours, overtime,leftover;
printf("\n\tHours Worked: " );
scanf( "%d", &hours );
if (hours>40){
leftover=(hours-40);
hours=40; }
if (hours>72) {
printf("\t72 Hours is Max Limit per Week!\n\t");
return 0;
}
printf( "\tHourly Rate of the Worker ($0.00): $" );
scanf("%f",&rate);
salary=(hours*rate)+(rate*1.5*leftover);
printf("\tSalary is $%f\n\n\t",salary);
return 0;
}
work? enjoy if it does.