-->
Showing posts with label program to get total salary depending upon worked hours. Show all posts
Showing posts with label program to get total salary depending upon worked hours. Show all posts

A company pays its employee on hourly basis.If an employee works for 8hrs hours he gets 100/hr and 120/hr for additional hours.Write a program to read working hours of an employee and calculate total salary.

//A company pays its employee on hourly basis.If an employee works for 8hrs hours he gets  100/hr
//and 120/hr for additional hours.
//Write a program to read working hours of an employee and calculate total salary.
#include<stdio.h>
#include<conio.h>
void main()
{
float total_working_hrs,extra_hrs;
float total_salary;
printf("enter your total working hours \n");
scanf("%f",&total_working_hrs);
if(total_working_hrs<=8)
    {
           total_salary=total_working_hrs*100
          printf("total salary=Rs. %f\n",total_salary);
    }
elseif(total_working_hrs>8)
    {
         extra_hrs=total_working_hrs-8;
          total_salary=extra_hrs*120+8*100;
         printf("the total salary earned=%f\n",total_salary);
      }

getch();
}