Basic salary of an employee is input through the keyboard. The DA is 25% of the basic salary
while the HRA is 15% of the basic salary. Provident Fund is deducted at the rate of 10% of the gross
salary (BS+DA+HRA). Program to calculate the Net Salary.
Answers
Answered by
1
hiiiiiiiiiii. sorry byeeeeeeeee
Answered by
0
Program in C++
#include<iostream>
using namespace std;
int main()
{
double basic;
cout<<"Enter the basic salary of an employee : ";
cin>>basic;
double DA = (basic * 25.0) / 100.0;
double HRA = (basic * 15.0) / 100.0;
double gross = basic + DA + HRA;
double PF = (gross * 10.0) / 100.0;
double net = gross - PF;
cout<<"Basic salary = "<<basic<<endl;
cout<<"DA = "<<DA<<endl;
cout<<"HRA = "<<HRA<<endl;
cout<<"Gross salary = "<<gross<<endl;
cout<<"Provident fund = "<<PF<<endl;
cout<<"Net salary = "<<net;
return 0;
}
Output:
Enter the basic salary of an employee : 100000
Basic salary = 100000
DA = 25000
HRA = 15000
Gross salary = 140000
Provident fund = 14000
Net salary = 126000
Similar questions