-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassigament one question one.c
More file actions
38 lines (33 loc) · 1.17 KB
/
assigament one question one.c
File metadata and controls
38 lines (33 loc) · 1.17 KB
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
#include <stdio.h>
int main()
{
char employmentStatus;
int yearsOfFreelancing;
double savingsBalance;
printf("Enter employment status : \n e for employed \n u for unemployed \n f for freelancer \n");
scanf(" %c", &employmentStatus);
// now we will apply conditions here and then we will give loans on the bases of requirement
if (employmentStatus == 'e') {
printf("You are eligible for the loan.\n"); }
else if (employmentStatus == 'u')
{ printf("Enter your savings balance: ");
scanf("%lf", &savingsBalance);
if (savingsBalance > 600000)
{ printf("You are eligible for the loan.\n"); }
else { printf("You are not eligible for the loan.\n"); } }
else if (employmentStatus == 'f')
{
printf("Enter your years of freelancing experience: ");
scanf("%d", &yearsOfFreelancing); printf("Enter your savings balance: ");
scanf("%lf", &savingsBalance);
if (yearsOfFreelancing >= 3 && savingsBalance > 300000)
{ printf("You are eligible for the loan.\n"); }
else
{ printf("You are not eligible for the loan.\n");
}
}
else
{ printf("Invalid employment status entered.\n");
}
return 0;
}