C Salary Sheet

06:05 Unknown 3 Comments

C Salary Sheet

This is simple program of salary sheet which ask you to input your basic salary then it'll calculate your gross and net income.



Here is the Code:

#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 float basic_pay,gross_pay,tax;
 printf("\t\t     ***************************");
 printf("\n\t\t\tSalary Sheet");
 printf("\n\t\t ***************************");
 printf("\n\nEnter Your Basic Salary : ");
 scanf("%f",&basic_pay);
 printf("\nConvience Allowness 20%% of Basic Pay : %.f",(0.2*basic_pay));
 printf("\n\nMedical Allowness 10%% of Basic Pay : %.f",(0.1*basic_pay));
 printf("\n\nHouse Rent 5%% of Basic Pay : %.f",(0.05*basic_pay));
 gross_pay=(basic_pay+(0.2*basic_pay)+(0.1*basic_pay)+(0.05*basic_pay));
 printf("\n\n\t\t============================");
 printf("\n\t\t\tGross Pay : %.f",gross_pay);
 printf("\n\t\t============================");
 tax=0.15*basic_pay;
 printf("\n\n\t\t============================");
 printf("\n\t\tTax 15%% of Basic Pay : %.f",tax);
 printf("\n\t\t============================");
 printf("\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
 printf("\n\n\t\t\tNet Income : %.f",gross_pay-tax);
 printf("\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
 getch();
}

Have Fun...!!!

3 comments: