C program to calculate the gross salary of an employe.
In this tutorial we will learn how to write a C program to calculate the gross salary of an employe with HRA,DA and PF.
HOUSE RENT ALLOWENCE (HRA)
DEARNESS ALLOWENCE (DA)
PROVIDENT FUND (PF)
#include<stdio.h>
#include<conio.h>
void main()
{
float basic_sal,da,hra,gross_Salary,pf;
printf("\n ENTER BASIC SALARY OF AN EMPLOYEE:\n ");
scanf("%f",&basic_sal);
hra = 0.21*basic_sal;
da = 0.48*basic_sal;
pf = 0.12*basic_sal;
gross_Salary=basic_sal+da+hra+pf;
printf("\n BASIC SALARY = %.2f\n",basic_sal);
printf("\n DEARNESS ALLOWENCE(DA) = %.2f\n",da);
printf("\n HOUSE RENT ALLOWENCE(HRA) = %.2f\n",hra);
printf("\n PROVIDENT FUND(PF) = %.2f\n",pf);
printf(" \n GROSS SALARY = %.2f\n",gross_Salary);
getch();
}
In this tutorial we will see that it is calculate the gross salary of an employe. In the first we will enter the basic salary of an employe and this program will print the HRA,DA,PF and GROSS SALARY of an employe.
In this tutorial we will learn how to write a C program to calculate the gross salary of an employe with HRA,DA and PF.
HOUSE RENT ALLOWENCE (HRA)
DEARNESS ALLOWENCE (DA)
PROVIDENT FUND (PF)
C program code
#include<stdio.h>
#include<conio.h>
void main()
{
float basic_sal,da,hra,gross_Salary,pf;
printf("\n ENTER BASIC SALARY OF AN EMPLOYEE:\n ");
scanf("%f",&basic_sal);
hra = 0.21*basic_sal;
da = 0.48*basic_sal;
pf = 0.12*basic_sal;
gross_Salary=basic_sal+da+hra+pf;
printf("\n BASIC SALARY = %.2f\n",basic_sal);
printf("\n DEARNESS ALLOWENCE(DA) = %.2f\n",da);
printf("\n HOUSE RENT ALLOWENCE(HRA) = %.2f\n",hra);
printf("\n PROVIDENT FUND(PF) = %.2f\n",pf);
printf(" \n GROSS SALARY = %.2f\n",gross_Salary);
getch();
}
OUTPUT:
In this tutorial we will see that it is calculate the gross salary of an employe. In the first we will enter the basic salary of an employe and this program will print the HRA,DA,PF and GROSS SALARY of an employe.
Please share this post and blog link with your friends.For more programs use this blog.
If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.If you have any method of this program or want to give any suggestion send email on hc78326@gmail.com
Created by-- HARSH CHAUHAN
No comments:
Post a Comment