Let us c solution

  PROBLEM   5.1 

Write a program to calculate overtime pau 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 main()

{

float otpay;

int hour,i=1;

while(i<=10)  

// loop for 10 employees

{

printf("\nEnter no. of hours worked:");

scanf("%d",&hour);

if(hour>=40)

otpay=(hour-40)*12;

else

otpay=0;

printf("Hours=%d Overtime pay=Rs.%f\n",hour,otpay);

i++;

}

Welcome to prgrmramit.blogspot.com! I'm Amit Singh, an expert in AI, Data Science, and Machine Learning. I created this blog to share practical insights and tips for those eager to learn and gro…

Post a Comment

Subscribe with Gmail


Premium By Raushan Design