Thursday, May 7, 2015

Write a program to calculate the gross salary of the employee

 Harish's basic salary is input through the keyboard. His dearness allowance is 40%, of basic salary, and     house rent allowance is 20% of basic salary, write a program to calculate his  gross salary.

#include<stdio.h>
#include<conio.h>
int main()
{
      float bp,da,hra,grpay;
     // clrscr();
      printf("Enter the Basic Pay of Harish:");
      scanf("%f",&bp);
      da=0.4*bp;
      hra=0.2*bp;
      grpay=bp+da+hra;
      printf("\nBasic Pay of Harish= %.2f",bp);
      printf("\nDearness Allowance= %.2f",da);
      printf("\nHouse Rent Allowance= %.2f",hra);
      printf("\nGross Pay of Ramesh is= %.2f",grpay);
      printf("\n\n\n\nPress any key to exit.....");
      getch();
           
     
      }
Output:-

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...