Example
#include<stdio.h>
#include<conio.h>
void main()
{
float bs,hra,da,pf,gs;
clrscr();
printf("Enter basic salary:");
scanf("%f",&bs);
hra=0.125*bs;
da=0.10*bs;
pf=0.025*bs;
gs=bs+hra+da-pf;
printf("\n========GROSS SALARY OF GIVEN ALLOWANCE===============\n");
printf("\nBasic salary =%.2f",bs);
printf("\nHouse rent allowance=%.2f",hra);
printf("\nDearness allowance =%.2f",da);
printf("\nProvisional fund =%.2f",pf);
printf("\n=======================================\n");
printf("\nGross salary =%.2f",gs);
getch();
}
/*=============================================================================
OUTPUT
Enter basic salary:1000
========GROSS SALARY OF GIVEN ALLOWANCE===============
Basic salary =1000.00
House rent allowance=125.00
Dearness allowance =100.00
Provisional fund =25.00
=======================================
Gross salary =1200.00 */
#include<stdio.h>
#include<conio.h>
void main()
{
float bs,hra,da,pf,gs;
clrscr();
printf("Enter basic salary:");
scanf("%f",&bs);
hra=0.125*bs;
da=0.10*bs;
pf=0.025*bs;
gs=bs+hra+da-pf;
printf("\n========GROSS SALARY OF GIVEN ALLOWANCE===============\n");
printf("\nBasic salary =%.2f",bs);
printf("\nHouse rent allowance=%.2f",hra);
printf("\nDearness allowance =%.2f",da);
printf("\nProvisional fund =%.2f",pf);
printf("\n=======================================\n");
printf("\nGross salary =%.2f",gs);
getch();
}
/*=============================================================================
OUTPUT
Enter basic salary:1000
========GROSS SALARY OF GIVEN ALLOWANCE===============
Basic salary =1000.00
House rent allowance=125.00
Dearness allowance =100.00
Provisional fund =25.00
=======================================
Gross salary =1200.00 */
No comments:
Post a Comment