# Write basic C program to calculate gross salary

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.

/* 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.

#### Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

### One thought on “Write basic C program to calculate gross salary”

• June 18, 2016 at 4:27 pm