Question-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.
Solution-
I am Starting 3rd chapter with problem, but i would highly recommend you to go the theory very well because this chapter is heart of c programming. it's contents are the most useful in making good c-program.Here is the solution.
#include<stdio.h>
int main()
{
int i,payment,time;
i=1;
while(i<=10)
{
printf("Enter the number of hours you worked\n");
scanf("%d",&time);
payment=(time-41)*12;
printf("Payment=%d\n",payment);
i++;
}
return 0;
}
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.
Solution-
I am Starting 3rd chapter with problem, but i would highly recommend you to go the theory very well because this chapter is heart of c programming. it's contents are the most useful in making good c-program.Here is the solution.
#include<stdio.h>
int main()
{
int i,payment,time;
i=1;
while(i<=10)
{
printf("Enter the number of hours you worked\n");
scanf("%d",&time);
payment=(time-41)*12;
printf("Payment=%d\n",payment);
i++;
}
return 0;
}
No comments:
Post a Comment