Calculate Gross Salary
Write a program to calculate gross salary of employee, basic salary is enter by the user, da is calculated on the basic of the following criteria.bsal | da |
below 5000 | 10% of bsal |
5000-10000 | 15% of bsal |
10000-20000 | 20% of bsal |
20000-above | 40% of bsal |
#include<stdio.h>
#include<conio.h>
void main()
{
int bsal, da, gsal;
printf("enter bsal = ");
scanf("%d",& bsal);
if(bsal<5000)
da=(bsal*0.10);
if((bsal>=5000)&&(bsal<10000))
da=(bsal*0.15);
if((bsal>=10000)&&(bsal<20000))
da=(bsal*0.20);
if(bsal>=20000)
da=(bsal*0.40);
gsal=bsal+da;
printf("Gross salary of employee is= %d",gsal);
getch();
}
Output:
* Click here, Simple Program to calculate gross salary of employee
*Click here, to Control Statement- if else statement
No comments:
Post a Comment