Answer to Question #218249 in C for Pawan

Question #218249
Write a c program to calculate the net salary where the basic salary is input and the DA is 35% of basic salary , hra is 25% of basis salary and income tax is 10.5% of gross salary respectively
1
Expert's answer
2021-07-17T10:42:12-0400
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>


int main()
{
	double basicSal;
	printf("Enter the basic salary: ");
	scanf("%lf", &basicSal);
	/*
	basic --100%
	x    -- 35%
	x=basic*35/100
	*/
	double ans = 0.0;
	double DA =basicSal-basicSal*0.35 ;//DA
	double HRA =basicSal-basicSal*0.25;//hra
	ans = basicSal + DA + HRA;
	printf("Net salary: %0.3lf\n", ans);
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS