Home Basic Loop Array string Function Pointer Contact STUDY

# AHF    C    PROGRAM    SOLVING

### Find the basic salary, facilities on total salary except tax

```
// AHF C PROGRAM SOLVING

//solving here basic type of programming problem

#include<stdio.h>
#include<math.h>
#define pf printf

int main()
{
int sal;

float mb,tax,hr,cb,ts;

pf("\nEnter total salary: ");
scanf("%d",&sal);

if(sal>28500)
{
tax=(sal*5)/100;
hr=(sal*7)/100;
cb=(sal*4)/100;
mb=1500;
}
else if(sal>18500 && sal<28500)
{
tax=(sal*3.5)/100;
hr=(sal*9)/100;
cb=(sal*6)/100;
mb=1800;
}
else if(sal>9500 && sal<18500)
{
tax=(sal*0)/100;
hr=(sal*10)/100;
cb=(sal*7.5)/100;
mb=2000;
}
else
pf("\nINVAILD INPUT OF SALARY.");

pf("\n\n||||||||||||||||||||||||||||||||||||||||||||||||||||");

pf("\n\nTAX of total salary= %.2f",tax);

pf("\nHouse Rent of total salary= %.2f",hr);

pf("\nConvince bill of total salary= %.2f",cb);

pf("\nMedical bill of total salary= %.2f",mb);

ts=sal-hr-cb-mb-tax;

pf("\n\nTHE BASIC SALARY=\t%.2f\n ",ts);

return 0;
}

```
OUTPUT: