Our Blog Contain Detail about Some Technical Aspect like Programming, Blogger, Tools and Tip, Suggestion, Motivational, Health, Program in C and Java, Html

Write a Program in C to calculate the Net Salary if basic salary is given

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.


Index

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

Introduction to Problem

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


Flow Chart




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




Share:

No comments:

Post a Comment

Translate

Followers

Email Subscription

Enter your email address:

Delivered by FeedBurner

Recent Posts

Theme Support

Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.