Posts

Showing posts with the label The Loop Control Structure

Chapter 3: The Loop Control Structure (Let Us C)

(a) 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. // Let Us C (Chapter 3 : The Loop Control Structure) : Program-1 /* 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<stdio.h> int i,T,OT=0,Total_OT,OT_Pay; void main() { clrscr(); for(i=1;i<=10;i++) { printf("\nEnter Total hours worked by Employee-%d: ",i); scanf("%d",&T); if(T>40) { OT = T-40; printf("OT pay for employee %d is Rs.%d/-",i,OT*12); } else { OT=0; printf("OT pay for employee %d is Rs.%d/-",i,OT*12); } ...