C Program to find the gross and net salary

by Nideesh C on April 18, 2011 · 2 comments

in C Programming




Here we divided the the employee into three categories according to his basic pay. The first category is getting the basic pay less than Rs.5000/-. Second category is having the basic between Rs.5000/- to Rs.10000/-, and the third is getting the basic more than Rs.10000/-. Basic idea here is to calculate the DA and TAX amount according to the category.
Finally it calculates the desired two as,
Gross = Basic + DA+ HRA  and,
Net = Gross- ( PF + Tax ).

We can add categories as we want. Also one can change the step values. Hope one can make it clear for himself the algorithm for the program by going through the codes.

#include<stdio.h>
void main()
{
float basic, da, hra, tax, pf, gross, net;
char name[50];
clrscr();
printf(“nnt ENTER YOUR NAME…:”);
scanf(“%s”, &name);
printf(“nt ENTER THE BASIC SALARY…:”);
scanf(“%f”, &basic);
pf = 0.08 * basic;
if (basic < 5000)
{
da = 0.3 * basic;
hra = 0.08 * basic;
}
else if ((basic >= 5000) && (basic < 10000))
{
da = 0.4 * basic;
hra = 0.1 * basic;
}
else
{
da = 0.5 * basic;
hra = 0.2 * basic;
}
gross = basic + da + hra;
net = gross – tax + pf;
printf(“nnt THE GROSS SALARY IS…: %f”, gross);
printf(“nnt THE NET SALARY IS…: %f”, net);
getch();
}

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to enter salary and output income tax and net salary.
  2. C program to create a file called emp.rec and store information about a person, in terms of his name, age and salary.
  3. C Program To find the biggest and smallest number and positions in the given array
  4. C Program – Find the sum of primary diagonal of a Matrix
  5. C Program To find the fibonacci numbers below a given number.

Leave a Comment

{ 2 trackbacks }

Previous post:

Next post: