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:
- Sample – Program to enter salary and output income tax and net salary.
- C program to create a file called emp.rec and store information about a person, in terms of his name, age and salary.
- C Program To find the biggest and smallest number and positions in the given array
- C Program – Find the sum of primary diagonal of a Matrix
- C Program To find the fibonacci numbers below a given number.

{ 2 trackbacks }