## Index

• Introduction to Problem
• Algorithm to solve the Problem
• Flow chart
• Program in C language
• Out Put

## Basic salary of an employee is input through the keyboard. The DA is 25% of the basic salary while the HRA is 15% of the basic salary. Provident Fund is deducted at the rate of 10% of the gross salary (BS+DA+HRA). Program to calculate the Net Salary.

as per the instruction calculate the gross salary there is need to calculate DA and HRA is need to be calculated. after that Net Salary is calculated by deducting the PF from it.

## Algorithm to solve the problem

Step 1: Take Basic salary as a Input from the user.
Step 2: then calculate the DA of basic salary using below formula
DA = (Basic salary * 25)/100

Step 3: then calculate the HRA of basic salary using below formula

HRA= (Basic salary * 15) / 100

Step 4: then we are going to calculate Gross Salary using below formula

GS = BS + DA + HRA

Step 5: after that Provident fund is deducted using below formula

Net Salary=GS - (GS*10)/100;

Step 6: Print the value of Net Salary

Step 7: Exit

## Program in C language

#include<stdio.h>
#include<conio.h>
void main()
{
double BS;
double DA,HRA,GS,NS,PF;
printf("Enter yours salary\n");
scanf("%lf",&BS);
DA= (BS * 25)/100;
HRA= (BS * 15)/100;
GS= BS+DA+HAR;
PF= (GS * 10)/100;
NS=GS-PF;
Print("Yours Net Salary is %lf",NS);
getch();

Out put