Ramesh's basic salary is input through the keyboard.His dearness allowance is 40% of basic salary and house rent is 20% of basic salary write a program to calculate his gross salary.


 #include<stdio.h>

void main()

{

float DA,HR,GS,BS;

printf("Enter your Basic Salary=");

scanf("%f",&BS);

DA=0.4*BS;

HR=0.2*BS;

GS=DA+HR+BS;

printf("\n BS:%f",BS);

printf("\n DA:%f",DA);

printf("\n HR:%f",HR);

printf("\n GS:%f",GS);

}



Post a Comment (0)
Previous Post Next Post