Calculate Wages

Write a Program to Calculate Wages:

 

HoursRate/Hours
First 840
Next 410
Next 420
Next 430
Next 440

Source Code:

#include<stdio.h>
#include<conio.h>
void main()
{
	int hour;
	clrscr();
	printf("Enter the hours:");
	scanf("%d",&hour);

	if(hour<=8)
	{
		printf("The salary of employee is=%d",(hour*40));
	}
	else if(hour<=12)
	{
		printf("The salary of employee is=%d",(320+(hour-8)*10));
	}
	else if(hour<=16)
	{
	printf("The salary of employee is=%d",(320+40+(hour-12)*20));
	}
	else if(hour<=20)
	{
	printf("The salary of employee is=%d",(320+40+80+(hour-16)*30));

	}
	else if(hour<=24)
	{
	printf("The salary of employee is=%d",(440+120+(hour-20)*40));
	}
	getch();

}
	
Output:

Enter the hours: 17
The salary of employee is = 470

Leave a Reply

Your email address will not be published. Required fields are marked *