-
Notifications
You must be signed in to change notification settings - Fork 0
/
bank management
62 lines (53 loc) · 1.09 KB
/
bank management
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Function to check balance
// in users account
void checkbalance(char username2[])
{
system("cls");
FILE* fm;
struct money m1;
char ch;
int i = 1, summoney = 0;
// Opening amount file record
fm = fopen("mon.txt", "rb");
int k = 5, l = 10;
int m = 30, n = 10;
int u = 60, v = 10;
gotoxy(30, 2);
printf("==== BALANCE DASHBOARD ====");
gotoxy(30, 3);
printf("***************************");
gotoxy(k, l);
printf("S no.");
gotoxy(m, n);
printf("TRANSACTION ID");
gotoxy(u, v);
printf("AMOUNT");
// Reading username to
// fetch the correct record
while (fread(&m1, sizeof(m1), 1, fm))
{
if (strcmp(username2,
m1.usernameto) == 0)
{
gotoxy(k, ++l);
printf("%d", i);
i++;
gotoxy(m, ++n);
printf("%s", m1.userpersonfrom);
gotoxy(u, ++v);
printf("%d", m1.money1);
// adding and
// finding total money
summoney = summoney + m1.money1;
}
}
gotoxy(80, 10);
printf("TOTAL AMOUNT");
gotoxy(80, 12);
printf("%d", summoney);
getch();
// Closing file after
// reading it
fclose(fm);
display(username2);
}