Skip to main content

C program to calculate Gross Salary of an employee

Programming Languages

Welcome to coding world

Write a C program to calculate Gross Salary of an employee

Write a C program by  https://houseofinformation31.blogspot.com/ to calculate Gross Salary of an employee. Here’s simple program to calculate Gross Salary of an employee in C Programming Language.

Gross salary:

We need to take input from user and then apply the simple formula to calculate the gross salary i.e. gross salary= basic salary+ dearness allowance+ house rent allowance.

Below is the source code for C program to calculate Gross Salary of an employee which is successfully compiled and run on Windows System to produce desired output as shown below:

SOURCE CODE:

/*  C program to calculate Gross Salary of an employee  */

#include <stdio.h>

 

int main()

{

 

    char name[30];

    float basic, hra, da, pf, gross;

 

    printf("Enter name: ");

    gets(name);

 

    printf("Enter Basic Salary: ");

    scanf("%f",&basic);

    printf("Enter HRA: ");

    scanf("%f",&hra);

    printf("Enter D.A.: ");

    scanf("%f",&da);

    

    /*pf automatic calculated 12%*/

    pf= (basic*12)/100;

 

    gross=basic+da+hra+pf;

 

    printf("\nName: %s \nBASIC: %f \nHRA: %f \nDA: %f \nPF: %f \n***GROSS SALARY: %f ***",name,basic,hra,da,pf,gross);

    

    return 0;

}

OUTPUT : 

Enter name: Salwa

    Enter Basic Salary: 23000

    Enter HRA: 9500

    Enter D.A.: 9500

     Name: Salwa

    BASIC: 23000.000000

    HRA: 9500.000000

    DA: 9500.000000

    PF: 2760.000000

    ***GROSS SALARY: 44760.000000 ***

Above is the source code for C program to calculate Gross Salary of an employee which is successfully compiled and run on Windows System.The Output of the program is shown above.

Popular posts from this blog

Good Morning Wishes

Explore the beauty of Murree | A memorable tour from Lahore to murree | Tour packing tips

Memorable Murree Getaway As we set off from Lahore, the excitement was palpable. The scenic drive to Murree was breathtaking, with lush green hills and winding roads. After a four-hour journey, we arrived in Murree, and the crisp mountain air invigorated us. We spent the day exploring Mall Road, browsing local shops, and savoring delicious food at restaurants. The stunning views of the hills and valleys left us spellbound. As the sun set, we settled into our cozy hotel, feeling grateful for this escape from the city's hustle. The next day, we visited the iconic Patriata Chair Lift (if operational) and took in the panoramic views. Our hotel's scenic location offered breathtaking sunrises and sunsets. As we reluctantly bid farewell to Murree and headed back to Lahore, memories of our time in the hills lingered. The trip was a perfect blend of adventure, relaxation, and rejuvenation. Highlights: - Scenic drive to Murree - Exploring Mall Road and local cuisine - Breathtaking views ...

Ayeza Khan Bridal collection 2021

Pakistan Showbiz Ayeza khan celebrate 10M on Instagram Ayeza Khan & Danish Taimoor love story