Skip to content

Instantly share code, notes, and snippets.

@jagdish4501
Created March 30, 2021 07:10
Show Gist options
  • Save jagdish4501/87762a5d6c9341beda62c56ee59b7ac0 to your computer and use it in GitHub Desktop.
Save jagdish4501/87762a5d6c9341beda62c56ee59b7ac0 to your computer and use it in GitHub Desktop.
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 main()
{
int p, nohw, how, owm;
//nohw=no of hour worked , how=hour over worked
//owm= over time worked money
for (p = 1; p <= 10; p++)
{
printf("enter you hour worked=");
scanf("%d", &nohw);
how = nohw - 40;
if (how >= 1)
{
owm = how * 12;
printf("your salary is = 'base salary'+%d Rs\n", owm);
}
else
printf("your salary is= 'base salery'\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment