Here is the Simple C Program To Calculate Salary of Employer.
Question:
(Salary Calculator) Develop a program that will determine the gross pay for each of several
employees. The company pays “straight time” for the first 40 hours worked by each employee and
pays “time-and-a-half” for all hours worked in excess of 40 hours. You’re given a list of the employees
of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee and should determine and display the employee's gross pay.
Source Code:
#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;
}
Note:
Any Question!!??
"Feel Free To Ask In Comments"
Like and Share or Follow us on Facebook and Instagram for more Programs Codes ;).
Email Us or inbox us to get Your Programs done :)
"Feel Free To Ask In Comments"
Like and Share or Follow us on Facebook and Instagram for more Programs Codes ;).
No comments:
Post a Comment