Calculate gross salary in C – coderinme

Calculate gross salary in C

This is the program to Calculate gross salary in C for input basic salary. The DA (dearness allowance) is 70%, HRA (House Rent Allowance) is 15%, TA (Travelling Allowance) is 20% of basic salary.

#include<stdio.h>
int main(){
	float bs,da,ha,ta,n;
	printf("Hi,Please input  Basic Salary\t");
	
	scanf("%f",&bs);
	
	da=(40/100.0)*bs;
	
	printf("\n Dearness Allowance = %.3f\t",da);
	
	ha=(15/100.0)*bs;
	
	printf("\n House-Rent Allowance = %.3f\t",ha);
	ta=(20/100.0)*bs;
	
	printf("\n Travelling Allowance = %.3f\t",ta);
	
	n=da+ha+ta+bs;
	
	printf("\n If Basic salary is %.3f  then Net Salary will be %.3f\t",bs,n);
	
	printf("\nIt's Coder in Me\n");	
	
	return 0;
			}

so the output  will beCalculate gross salary in C

Click here for new Post and Updates

Leave a reply:

Your email address will not be published.