Translate

Tuesday, April 28, 2020

C Program to calculate gross salary of an employee

/* Enter Basic Salary and Calculate Gross Salary of employee */

#include<stdio.h>
#include<conio.h>
void main()
{
    float bs, gs, da, hra;
    printf("Enter Basic Salary = ");
    scanf("%f", &bs);
    if(bs<1500)
      {
          hra=bs*10/100;
          da=bs*90/100;
      }
      else
      {
          hra=500;
          da=bs*98/100;
      }
      gs=bs+hra+da;
      printf("Gross salary = Rs %f", gs);
      getch();
}
Output:





No comments:

Post a Comment

C program to make a calculator using the switch statement.

/*perform arithmetic calculation on integers in C language*/ #include<stdio.h> #include<conio.h> void main() {     char op;     ...