Write basic C program to calculate gross salary
![write a c program to calculate gross salary write a c program to calculate gross salary](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_583,h_625/http://blog.eduguru.in/wp-content/uploads/2016/03/write-a-c-program-to-calculate-gross-salary.png)
Write a C Program for the following :-
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.
Answer:
/* To Calculate the gross salary of Ramesh */
#include<stdio.h>
#include<conio.h>
main()
{
float bp,da, hra, grpay;
clrscr(); /* TO Clear Screen*/
printf(“\n Enter the Basic Pay of Ramesh:”);
scanf(“%f”,&bp);
da=0.4*bp;
hra=0.2*bp;
grpay=bp+da+hra; /* Gross pay = Sum of basic+All allowance */
printf(“\n Basic Pay of Ramesh=%f”, bp);
printf(“\n Dearness Allowance of Ramesh=%f”, da);
printf(“\n House Rent of Ramesh=%f”, hra);
printf(“\n Gross Pay of Ramesh=%f”, grpay);
Printf(“/n/n/n/n/n Press any key to exit….”);
getch(); /* Readsd a character from keyboard */
}
Run this program and tell us your output.
It’s amazing for me to have a website, which is useful designed for my knowledge.
thanks admin