Tuesday, December 24, 2013

Program to calculate the net salary of a person

Source Code:
#include<conio.h>
#include<stdio.h>
int main()
{
int b=0,s,H,D,t;
clrscr();
printf("\n enter the basic salary:");
scanf("%d",&b);
printf("\n the basic salary is:%d",b);
if(b<10000)
{
 H=(b*15)/100;
 D=(b*85)/100;
 t=(b*12)/100;
 s=b+H+D+t;
 printf("\n the net salary is :%d",s);
}
else
{
 H=(b*20)/100;
 D=(b*92)/100;
 t=(b*22)/100;
 s=b+H+D+t;
 printf("\n the net salary is :%d",s);
 }
getch();
return 0;

No comments:

Post a Comment