Pages

Monday, June 27, 2011

Gross Salary Program(Ref: Let us c-chapter1)

This program calculate gross salary of an employee if his basic slaray is input thru keyboard.


Ramesh's basic salary is input throught the keyboard.His dearness allowance is 40% of basic salary,and house rent allowance is 20% of basic salary.Write a program to calclate gross salary.

#include<stdio.h>
void main()
{

float bs,gs,hra,da;
clrscr();
printf("Enter basic salary:");
scanf("%f",&bs);
hra=bs*20/100;
da=bs*40/100;
gs=bs+hra+da;
printf("Gross salary= %f",gs);
getch();
}

No comments: