13. Write a c program to prepare pay slip using following data. Da = 10% of basic, Hra = 7.50% of basic, Ma = 300, Pf = 12.50% of basic, Gross = basic + Da + Hra + Ma, Nt = Gross – Pf.
#include<stdio.h>
#include<conio.h>
void main()
{
float da,ma,hra,pf,gross,nt,basic;
printf(" Payslip \n");
printf("----------------------------------------\n");
printf("Enter the Basic salary: ");
scanf("%f",&basic);
da=(10*basic)/100;
ma=300;
pf=((12.5)*basic)/100;
hra=((7.5)*basic)/100;
gross=basic+da+hra+ma;
nt=gross-pf;
printf("da=%f ma=%f\n",da,ma);
printf("hra=%f pf=%f\n",hra,pf);
printf("----------------------------------------\n");
printf(" gross=%f \n",gross);
printf(" nt=%f \n",nt);
getch();
}
#OUTPUT:
#include<conio.h>
void main()
{
float da,ma,hra,pf,gross,nt,basic;
printf(" Payslip \n");
printf("----------------------------------------\n");
printf("Enter the Basic salary: ");
scanf("%f",&basic);
da=(10*basic)/100;
ma=300;
pf=((12.5)*basic)/100;
hra=((7.5)*basic)/100;
gross=basic+da+hra+ma;
nt=gross-pf;
printf("da=%f ma=%f\n",da,ma);
printf("hra=%f pf=%f\n",hra,pf);
printf("----------------------------------------\n");
printf(" gross=%f \n",gross);
printf(" nt=%f \n",nt);
getch();
}
#OUTPUT:
Comments
Post a Comment