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

Bollywood actor Dharmendra has passed away at the age of 89

Legendary Bollywood actor Dharmendra has passed away at the age of 89.  R. I. P The 'He-Man' of Indian cinema, known for his iconic roles in films like 'Sholay', 'Seeta Aur Geeta', and 'Dharam Veer', breathed his last on November 24, 2025, in Mumbai. Dharmendra's career spanned over six decades, with more than 300 films to his credit. He was a recipient of the Filmfare Lifetime Achievement Award and the Padma Bhushan, among other accolades. His family, friends, and fans are mourning his loss, remembering him as a kind soul and an unforgettable icon of Indian cinema. 

Sales and Marketing jobs in UAE | Jobs in dubai 2026 | latest Gulf jobs 2026

   Mobile Number: 0553390204    WhatsApp Number: +971553390204                                                                          

C++ Program to Display Number (Entered by the User)

Programming Languages Welcome to coding world   Write a C++ Program to Display Number (Entered by the User). Here’s simple Program to Print Number (Entered by the User) in C++ Programming Language. This program asks user to enter a number. When user enters an integer, it is stored in variable number using cin. Then it is displayed in the screen using cout. Here is source code of the C++ Program to Display Number (Entered by the User). The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.   SOURCE CODE : /*   C++ Program to Display Number (Entered by the User)   */   #include <iostream> using namespace std;   int main() {     int number;       cout << "Enter an integer :: ";     cin >> number;       cout << "\nThe Number entered is :: " << number...