#include #include struct user { char user_name[10]; char bank_name[10]; int account_num[4]; int card_number[14]; int pass[4]; int balance; int wallet_num[11]; }; int num_acc; int withdrawal; int deposition; char transaction; int k; int number_of_papers; int choice4; void print_array(int arr[], int size) { for (int i = 0; i < size; i++) { printf("%d", arr[i]); } printf("\n"); } void print_struct(char username[], char bankname[], int accountnum[], int size3, int cardnum[], int size4, int balance) { printf("Username is %s", username); printf("\nBankname is %s\n", bankname); printf("Account number is "); print_array(accountnum, size3); printf("Cardnumber is "); print_array(cardnum, size4); printf("Balance is %d\n", balance); } void scan_array(int arr[], int size) { for (int i = 0; i < size; i++) { scanf_s("%d", &arr[i]); } } int search_name_in_array(struct user user[], int size1, char arr[]) { int flag = -1; for (int i = 0; i < size1; i++) { if (strcmp(user[i].user_name, arr) == 0) { flag = i; } } return flag; } int main() { //Making a modern ATM struct user user[4] = { {"doha" , "cib" , {2 ,0,0,4},{2,0,2,2,0,0,4,2,0,2,2,0,0,4} , {2,2,2,2} , 2000000 ,{0,1,1,2,3,4,5,6,7,8,9} }, {"ahmed" , "bm" , {2 ,0,0,3},{9,1,0,2,0,0,3,9,1,0,2,0,0,3} , {0,4,2,0} , 2500000, {0,1,0,2,3,4,5,6,7,8,9} }, {"yara" , "ahly" , {2 ,0,0,2},{4,2,2,6,1,1,1,7,2,9,1,4,0,2} , {2,6,1,1}, 57800,{0,1,0,3,4,5,6,7,8,9,0}}, {"jana" , "nbk" , {2 ,0,0,5},{1,7,1,1,2,0,3,1,7,1,1,2,0,3} , {1,7,1,1}, 2500 , {0,1,1,4,5,6,7,8,9,0,1} } }; A flowchart for that part of a code.
#include <stdio.h>
#include <string.h>
struct user {
char user_name[10];
char bank_name[10];
int account_num[4];
int card_number[14];
int pass[4];
int balance;
int wallet_num[11];
};
int num_acc;
int withdrawal;
int deposition;
char transaction;
int k;
int number_of_papers;
int choice4;
void print_array(int arr[], int size)
{
for (int i = 0; i < size; i++)
{
printf("%d", arr[i]);
}
printf("\n");
}
void print_struct(char username[], char bankname[], int accountnum[], int size3, int cardnum[], int size4, int balance)
{
printf("Username is %s", username);
printf("\nBankname is %s\n", bankname);
printf("Account number is ");
print_array(accountnum, size3);
printf("Cardnumber is ");
print_array(cardnum, size4);
printf("Balance is %d\n", balance);
}
void scan_array(int arr[], int size)
{
for (int i = 0; i < size; i++) {
scanf_s("%d", &arr[i]);
}
}
int search_name_in_array(struct user user[], int size1, char arr[]) {
int flag = -1;
for (int i = 0; i < size1; i++) {
if (strcmp(user[i].user_name, arr) == 0)
{
flag = i;
}
}
return flag;
}
int main()
{
//Making a modern ATM
struct user user[4] = { {"doha" , "cib" , {2 ,0,0,4},{2,0,2,2,0,0,4,2,0,2,2,0,0,4} , {2,2,2,2} , 2000000 ,{0,1,1,2,3,4,5,6,7,8,9} },
{"ahmed" , "bm" , {2 ,0,0,3},{9,1,0,2,0,0,3,9,1,0,2,0,0,3} , {0,4,2,0} , 2500000, {0,1,0,2,3,4,5,6,7,8,9} },
{"yara" , "ahly" , {2 ,0,0,2},{4,2,2,6,1,1,1,7,2,9,1,4,0,2} , {2,6,1,1}, 57800,{0,1,0,3,4,5,6,7,8,9,0}},
{"jana" , "nbk" , {2 ,0,0,5},{1,7,1,1,2,0,3,1,7,1,1,2,0,3} , {1,7,1,1}, 2500 , {0,1,1,4,5,6,7,8,9,0,1} }
};
A flowchart for that part of a code.
Step by step
Solved in 2 steps with 2 images