Program to Calculate Gross Salary - C Program

Program to Calculate Gross Salary

  #include<stdio.h>
  int main()
  {
	float basic,da,hra,gross_salary;
	
	printf("Enter the basic salary :");
	scanf("%f",&basic);
	da=basic*40/100;
	hra=basic*20/100;
	gross_salary=basic+da+hra;
	printf("DA=%f\nHRA=%f\nGross salary=%f",da,hra,gross_salary);
	
	return 0;
  }

Output - Program to Calculate Gross Salary

Enter the basic salary :4000                                                                                          
DA=1600.000000                                                                                                        
HRA=800.000000                                                                                                        
Gross salary=6400.000000 
Compile and Run Online