C Programming: basic salary and gross salary

Posted on:
tags: , , ,

Q-1: Mr. Aggarwal is an employee of a Private Firm. His Basic salary is Rs. 5500/-(suppose) . Now the dearness allowance is 74% of his basic salary and house rent allowance is 15% of basic salary. Write a program to calculate his gross salary.
#include<stdio.h>
#include<conio.h>
void main()
{
                float gs,da,bs,hr;

                clrscr();
                                printf("\n\t\tENTER THE BASIC SALARY OF AN EMPLOYEE:");
                                scanf("%f",&bs);
                                da=(bs*74)/100;
                                hr=(bs*15)/100;
                                gs=bs+hr+da;
                                printf("\n\t\tTHE GROSS SALARY:%f",gs);
                getch();
}

No comments:

Post a Comment

< >