C++ Program To Calculate Gross Salary

What we are going to see through this article is we will see in detail C++ Program To Calculate Gross Salary. To calculate the gross salary all the facts in salary like da,hra, basic salary also included. The addition of all salary elements shows the gross salary chart.

C++ Program To Calculate Gross Salary

C++ Program to Calculate Gross Salary

/* C++ Program to calculate gross salary of an employee */
#include <iostream>
using namespace std;

int main()
{
    double Basic_Salary, DA, HRA, Gross_Salary;
    
    cout << "Enter Basic Salary : ";
    cin >> Basic_Salary;
    
    DA = (Basic_Salary * 40) / 100;
    HRA = (Basic_Salary * 20) / 100;
    Gross_Salary = Basic_Salary + DA + HRA;
    
    cout << "\n\nDearness Allowance 40 % of Basic Salary : " << DA;
    cout << "\nHouse Rent 20 % of Basic Salary : " << HRA;
    cout << "\nGross Salary : " << Gross_Salary;
    
    return 0;
}

Output

Enter Basic Salary : 20000

Dearness Allowance 40 % of Basic Salary : 8000
House Rent 20 % of Basic Salary : 4000
Gross Salary : 32000

Read Also: Student Management System In C++

Final Words

What we learned through this article is to C++ Program To Calculate Gross Salary. Also if you have any doubts please leave a comment via the comment box. And we ask that you benefit everyone who shared this article with your friends.

Leave a Comment