forked from CPRO-Session1/Assignment6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbanking.c
More file actions
40 lines (30 loc) · 709 Bytes
/
Copy pathbanking.c
File metadata and controls
40 lines (30 loc) · 709 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
#include <stdio.h>
#include <string.h>
typedef struct bankAccount{
char name;
float balance;
int accountNumber;
}Account;
float money(float x){
float balance;
printf("Please type in the amount of money you want to change:\n");
scanf("%f",&x);
balance=balance+x;
return balance;
}
int main(){
Account ac1;
strcpy(ac1.name,"Marry");
ac1.balance=5000;
ac1.accountNumber=123;
float x;
money(x);
printf("The change in your account is \"%f\", your balance is \"%f\"\n",x,ac1.balance);
Account ac2;
strcpy(ac2.name,"Maria");
ac2.balance=10000;
ac2.accountNumber=456;
money(x);
printf("The change in your account is \"%f\", your balance is \"%f\" \n",x,ac2.balance);
return 0;
}