Ramesh basic salary is input through the keyword .His dearness allowance is 40% of the basic salary and house rent allowance is 20% of basic salary write a program to calculate his gross salary.
Ramesh basic salary is input through the keyword .His dearness allowance is 40% of the basic salary and house rent allowance is 20% of basic salary write a program to calculate his gross salary.
//calculate Ramesh gross salary
#include<stdio.h>
int main(){
float bp,da ,hra, grpay;
printf("\n Enter the value basic salary of ramesh:");
scanf("%f",&bp);
da=0.4*bp;
hra =0.2*bp;
grpay=bp+da+hra;
printf("Basic salary of Ramesh=%f\n",bp);
printf("Dearness allowance=%f\n",da);
printf("House rent allowance=%f\n",hra);
printf("Gross pay of Ramesh is %f\n",grpay);
return 0;
}
output---Enter the value basic salary of ramesh:1200
basic salary of ramesh:1200.000
Dearness allowance=480.0000
house rent of allowance=240.00000
gross pay of ramesh's is =1920.000
Comments
Post a Comment