Thursday 30 August 2012

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


main()
{
 float b_s,D_A,HRA,G_S;
 printf("Enter basic salary of Ramesh");
 scanf("%f",&b_s);
 D_A =(float)40/100*b_s;
 HRA =(float)20/100*b_s;
 G_S = b_s + D_A + HRA;
 printf("%f is the gross salary of Ramesh",G_S);
}

output:- 

1 comment: