void menu() { int choice; printf("\n\n\t\t\tCUSTOMER ACCOUNT BANKING MANAGEMENT SYSTEM"); printf("\n\n\n\t\t\t WELCOME TO THE MAIN MENU "); printf("\n\n\t\t1.Create new account\n\t\t2.Update information of existing account\n\t\t3.For transactions\n\t\t4.Check the details of existing account\n\t\t5.Removing existing account\n\t\t6.View customer's list\n\t\t7.Exit\n\n\n\n\n\t\t Enter your choice:"); scanf("%d",&choice); switch(choice) { case 1:add_acc(); break; case 2:mod_acc(); break; case 3:transaction_acc(); break; case 4:see(); break; case 5:delete_acc(); break; case 6:view_list(); break; case 7:close(); break; } }
int start(){ struct node *head; head = (struct node*) malloc(sizeof(struct node)); head->next = NULL; head->payload = 0; head->id = 0; int selection = 0; do{ selection = menu(); switch(selection){ case 1: add_node(head); break; case 2: remove_node(head); break; case 3: view_list(head); break; case 4: break; case 0: break; default: break; } }while(selection != 0); return 0; }
int main (void) { system ("clear"); node_t *head = NULL; int choice = 0; int n; while (TRUE) { print_menu(); scanf("%d", &choice); switch(choice) { case 1: head = insert_rear(head); view_list(head); break; case 2: head = insert_front(head); view_list(head); break; case 3: head = delete_rear(head); view_list(head); break; case 4: head = delete_front(head); view_list(head); break; case 5: print_reverse(head); printf("\n"); break; // case 6: // link_sort1(head); // view_list(head); // break; case 7: head = reverse_list_iterative(head); view_list(head); break; case 8: head = reverse_list_recursive(head); view_list(head); break; case 9: head = swap_alternate(head); view_list(head); break; case 10: head = insert_sorted(head); view_list(head); break; case 11: printf ("Enter the Value of n: "); scanf ("%d", &n); head = reverse_n_list(head, n); view_list(head); break; case 100: view_list(head); break; default : printf("Invalid Choice\n"); } } return 0; }