/* To calculate
the gross salary of an employee */
#include<stdio.h>
#include<conio.h>
void
main()
{
 float bs,da,hra,gs;
 clrscr();
 printf("Enter the basic salary: ");
 scanf("%f",&bs);
 /* To
calculate gross salary */
 if(bs<=1500)
 {
   hra=10*bs/100.00;
   da=90*bs/100.00;
 }
 else
 {
   hra=500;
   da=98*bs/100.00;
 }
 gs=bs+hra+da;
 printf("\nGross Salary=%f",gs);
 getch();
}
OUTPUT
Enter
the basic salary: 1050.50
Gross
Salary=2101.000000
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.