Saturday, January 19, 2013

C Language Example # 07 Salary Calculation with DA HRA and Medical Allowance Using C

C Language Example # 07 Salary Calculation with DA HRA and Medical Allowance Using C

* Lets Calculate the Net Salary based on Basic Salary, HRA, DA, and Medical Allowance.
* Formula to calculate net salary from hra and medical allowance
* Example programming C language calculating wages

C Language Code:

//Written by Latest Technology Guide    
//Title : Example 07 : Salary Calculation with DA HRA and Medical Allowance Using C.
  
#include <stdio.h>
#include <conio.h>

void main()
{
clrscr();
float basic_salary,da,hra,medical,deduction,insurance,pf,gross,net_s;

printf("Enter Basic Salary :");
scanf("%f",&basic_salary);

da=0.45*basic_salary;
hra=0.15*basic_salary;
medical=0.05*basic_salary;
gross=basic_salary+da+hra+medical;
pf=0.04*gross;
insurance=0.06*gross;
deduction=insurance+pf;
net_s=gross-deduction;

printf("=================================");
printf("\nNet Salary is      :%.2f",net_s);

getch();
}


Output:

We think there is no need of Output for this program.


--------------------------------------------------------------------------------
Explanation of C Language Example # 07 Salary Calculation with DA HRA and Medical Allowance Using C.

* Enter Basic Salary.
* In Program we have assumed percentage for DA, HRA and Medical, You can modify accordingly your need.

Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

1 comment:

  1. thank you for sharing nice article in your blog
    visit
    web tutorial programming
    https://www.welookups.com

    ReplyDelete