-
Notifications
You must be signed in to change notification settings - Fork 0
/
grossSalary.c
38 lines (34 loc) · 1.07 KB
/
grossSalary.c
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
/**
* @file grossSalary.c
* 25 Write a program to input basic salary of an employee and calculate its Gross salary according to
following:
Basic Salary <= 10000: HRA = 20%, DA = 80%
Basic Salary <= 20000: HRA = 25%, DA = 90%
Basic Salary > 20000: HRA = 30%, DA = 95%
* @author Md. Alamin (alamin5g@yahoo.com)
* I would love be a software engineer at Google. That is why anybody can uses this code without any condition, if you face any difficulty, then try to email me.
* @version 0.1
* @date 2022-03-13
*
* @copyright Copyright (c) 2022
*
*/
#include <stdio.h>
void main(){
int basic;
float gross;
printf("Enter basic salary to calculate gross salary: ");
scanf("%d", &basic);
if (basic<= 10000)
{
gross = (basic*0.20) + (basic*0.80);
printf("Gross salary is: %.2f",gross);
}else if (basic <= 20000)
{
gross = (basic*0.25) + (basic*0.90);
printf("Gross salary is: %.2f",gross);
} else{
gross = (basic*0.30) + (basic*0.95);
printf("Gross salary is: %.2f",gross);
}
}