-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc1p1.c
More file actions
26 lines (26 loc) · 789 Bytes
/
c1p1.c
File metadata and controls
26 lines (26 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*Ramesh basic salary is input through the keyboard
His dearness allowanc is 40% of basic salary, and house rent allowance is 20% of basic salary
Write a program to calculate his gross salary*/
/* Calculate Ramesh's gross salary*/
#include <stdio.h>
int main()
{
float bp, da, hra, grpay;
printf("\nEnter 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:
Basic Salary of Ramesh= 1200.0000
Dearness Allowance = 480.00000
House Rent Allowance= 240.00000
Gross Pay of Ramesh is 1920.0000
*/