C program to find the total salary of an employee .

 Hello everyone,

This program in c helps to find the total salary of an employee from the given specifications, here is the question .


Question :  

             WAP to calculate total salary of an employee as per the given specification

             DA=40%,TA=15%,HRA=10%,PF=9% 

                                 Total Salary=Basic +DA+TA+HRA-PF

Here's is the code for this question :

#include<stdio.h>

#include<conio.h>

void main()

{

float basic,da,ta,hra,pf;

float ts;

clrscr();

printf("please enter the basic \t");

scanf("%f",&basic);

da=0.4*basic;

ta=0.15*basic;

hra=0.1*basic;

pf=0.09*basic;

ts=da+ta+hra+basic-pf;

printf("da is %f",da);

printf("ta is %f",ta);

printf("hra is %f",hra);

printf("pf is %f",pf);

printf("total salary of an employee is %f",ts);

getch();

}

And here is the  output 


Hope you enjoyed and tuned in for more such exiting codes. 

See you guys in the next program.








Comments

Popular Posts