C program to calculate Gross salary of an employee with HRA,DA - My CS Tutorial - My CS Tutorial

Breaking

Programming languages full tutorial and programs, exam papers, visual basic( Vb.net ), information of new technologies and more....

Monday, January 6, 2020

C program to calculate Gross salary of an employee with HRA,DA - My CS Tutorial

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)


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