-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ6.c
More file actions
46 lines (35 loc) · 975 Bytes
/
Q6.c
File metadata and controls
46 lines (35 loc) · 975 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
struct employee
{
float basic_salary;
float grade_pay;
float TA;
float DA;
float loans;
float tax;
float LIC;
};
int main()
{
struct employee emp;
float gross_salary, net_salary;
printf("Enter the basic salary: ");
scanf("%f", &emp.basic_salary);
printf("Enter the grade pay: ");
scanf("%f", &emp.grade_pay);
printf("Enter the TA: ");
scanf("%f", &emp.TA);
printf("Enter the DA: ");
scanf("%f", &emp.DA);
printf("Enter the loans: ");
scanf("%f", &emp.loans);
printf("Enter the tax: ");
scanf("%f", &emp.tax);
printf("Enter the LIC: ");
scanf("%f", &emp.LIC);
gross_salary = emp.basic_salary + emp.grade_pay + emp.TA + emp.DA;
net_salary = gross_salary - emp.loans - emp.tax - emp.LIC;
printf("Gross Salary: $%.2f\n", gross_salary);
printf("Net Salary: $%.2f\n", net_salary);
return 0;
}