18-Write a C program to calculate the gross salary of an employee.

Program: 18

Write a C program to calculate the gross salary of an employee.

#include
#include
void main()
{
    float bs, gs, da, hra;
    printf("Enter basic salary: ");
    scanf("%f", &bs);
    if(bs<1500)
    {
        hra=bs*0.10;
    da=bs*0.90;
    }
    else
    {
        hra=500;
        da=bs*0.98;
    }
    gs=bs+hra+da;
    printf("Gross Salary is %f.", gs);
    getch();
}
Output
Enter basic salary: 30293

Gross Salary is 60480.140625.

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.