In this program user ask to calculate the gross salary of employees. To calculate the gross salary all the facts in salary like da,hra,basic salary also included. The addition of all salary element show out the gross salary chart.
In this program user declare the float type variables to store the content or value. After entering the basic salary user ask to find the hra, da with manipulation to basic salary with required conditions.. After calculating the elements add them all to find the gross salary. In the last to print out the gross salary chart on screen.
Problem Statement:
This is C program to calculate the gross salary of organizational employees.
- Declaring the variable.
- Finding the Hra, Da of an employee.
- Calculate the gross salary.
- Display the result on the screen.
Here is C source code for calculating the gross salary of employees. The output of this program shown below.
#include<stdio.h>
void main()
{
float da,hra,bs,gs;
clrscr();
printf("Enter the Basic Salary : ");
scanf("%f",&bs);
da=(40*bs)/100;
hra=(20*bs)/100;
gs=da+hra+bs;
printf("The Gross Salary is : %f",gs);
getch();
}
Output :