Overtime Pay
Write a program to calculate overtime pay of 10 employees.Overtime is paid at the rate of Rs.12.00 per hour for every hour worked above 40 hours.Assume that employees do not work for fractional part of an hour.
#include
#include
void main(void)
{
clrscr();
int b,a,c,d;
int i;
for(i=0;i<10;i++)
{
printf("Enter the number of hours of employee %d:",i+1);
scanf("%d",&b);
c=b-40;
d=c*12;
if(d<12)
printf("This employee had not done any extra hours\n");
else
printf("The amount to be paid is %d\n",d);
}
getch();
}
#include
#include
void main(void)
{
clrscr();
int b,a,c,d;
int i;
for(i=0;i<10;i++)
{
printf("Enter the number of hours of employee %d:",i+1);
scanf("%d",&b);
c=b-40;
d=c*12;
if(d<12)
printf("This employee had not done any extra hours\n");
else
printf("The amount to be paid is %d\n",d);
}
getch();
}
Comments
Post a Comment