Bank Management System in C with Source Code

The Bank Management System project in C is a consoled-based application created using c programming language.

This system is a simple mini project and compiled in Code::Blocks IDE using GCC compiler. This system it is centered around client account administrations in bank accounts, so it is named “Client Account Bank Management System”.

Moving on, this simple mini project for the Bank Management System is complete and totally error-free and also includes a downloadable Source Code for free, just find the downloadable source code below and click to start downloading.

Anyway, you can make another record, update data of a current record, see and oversee exchanges, check the information of existing accounts, eliminate details of existing account records, and view clients’ lists.

However, the source code for the Bank Management System is generally short and straightforward. I have partitioned this C smaller than expected task into numerous capacities, a large portion of which are identified with various financial exercises.

Also, if you want to level up your knowledge in programming, especially C/C++ Programming Language, try this new article I’ve made for you Best C Projects with Source Code for Beginners Free Download.

To start creating a Bank Management System using C, make sure that you have Code Blocks or any platform of C installed in your computer.

Project Information and Recommended Tools Used

Project Name : Bank Management System
Project Platform :C/C++
Programming Language Used:C Programming Language
IDE Tool (Recommended):Dev-C++/Codeblocks
Project Type :Desktop Application
Bank Management System C with Source Code Information

Steps on how to create a Bank Management System project in C

Time needed: 5 minutes

Bank Management System in C with Source Code

  • Step 1: Create a new project.

    First open the code blocks IDE and click “create a new project“.Click Create New Project in Bank Management System in C with Source Code

  • Step 2: Choose console application.

    Second click the “console application” and after that click “next“.

  • Step 3: Choose C language.

    Third choose “C language” and click “next“.

  • Step 4: Name your project.

    Fourth name the project you’ve created and click “next” after that click “finish“.Naming Project title in Bank Management System in C with Source Code

  • Step 5: The actual code.

    You are free to copy the given source code below or download the downloadable source code given.

This function is for the date

In the code given below, which is for the function for the date use in the system.

struct date_now{
int mm,dd,yy;
};

This function is for the structure of clients attributes

In the code given below, which is for the function for the structure of clients attributes use in the system.

struct {
char client_name[60]; int account_number,client_age; char client_address[60]; char client_citizenship[15]; double client_phone; char client_account_type[10]; float client_amount; struct date_now client_dob; struct date_now client_deposit; struct date_now client_withdraw; }adding,updating,checking,remittance,trans; 

This function is for the adding new accounts

In the code given below, which is for the function to add new client accounts records.

void new_accounts()
{
int options;
FILE *fileOpen;
fileOpen=fopen("record.dat","a+"); acct_no: system("cls"); printf("\t\t\t\xB2\xB2\xB2\ ADD RECORD \xB2\xB2\xB2\xB2"); printf("\n\n\nEnter today's date(mm/dd/yyyy):"); scanf("%d/%d/%d",&adding.client_deposit.mm,&adding.client_deposit.dd,&adding.client_deposit.yy); printf("\nEnter the account number:"); scanf("%d",&checking.account_number); while(fscanf(fileOpen,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",&adding.account_number,adding.client_name,&adding.client_dob.mm,&adding.client_dob.dd,&adding.client_dob.yy,&adding.client_age,adding.client_address,adding.client_citizenship,&adding.client_phone,adding.client_account_type,&adding.client_amount,&adding.client_deposit.mm,&adding.client_deposit.dd,&adding.client_deposit.yy)!=EOF) { if (checking.account_number==adding.account_number) {printf("Account no. already in use!"); fordelay(1000000000); goto acct_no; } } adding.account_number=checking.account_number; printf("\nEnter the name:"); scanf("%s",adding.client_name); printf("\nEnter the date of birth(mm/dd/yyyy):"); scanf("%d/%d/%d",&adding.client_dob.mm,&adding.client_dob.dd,&adding.client_dob.yy); printf("\nEnter the age:"); scanf("%d",&adding.client_age); printf("\nEnter the address:"); scanf("%s",adding.client_address); printf("\nEnter the citizenship number:"); scanf("%s",adding.client_citizenship); printf("\nEnter the phone number: "); scanf("%lf",&adding.client_phone); printf("\nEnter the amount to deposit:$"); scanf("%f",&adding.client_amount); printf("\nType of account:\n\t#Saving\n\t#Current\n\t#Fixed1(for 1 year)\n\t#Fixed2(for 2 years)\n\t#Fixed3(for 3 years)\n\n\tEnter your choice:"); scanf("%s",adding.client_account_type); fprintf(fileOpen,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); fclose(fileOpen); printf("\nAccount created successfully!"); add_inv: printf("\n\n\n\t\tEnter 1 to go to the main menu and 0 to exit:"); scanf("%d",&exits); system("cls"); if (exits==1) menu(); else if(exits==0) close(); else { printf("\nInvalid!\a"); goto add_inv; }
}

This function is for the view list of records

In the code given below, which is for the function to view the list of records of clients.

void view_list()
{
FILE *viewing;
viewing=fopen("record.dat","r");
int tst=0;
system("cls");
printf("\nACC. NO.\tNAME\t\t\tADDRESS\t\t\tPHONE\n");
while(fscanf(viewing,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&adding.account_number,adding.client_name,&adding.client_dob.mm,&adding.client_dob.dd,&adding.client_dob.yy,&adding.client_age,adding.client_address,adding.client_citizenship,&adding.client_phone,adding.client_account_type,&adding.client_amount,&adding.client_deposit.mm,&adding.client_deposit.dd,&adding.client_deposit.yy)!=EOF) { printf("\n%6d\t %10s\t\t\t%10s\t\t%.0lf",adding.account_number,adding.client_name,adding.client_address,adding.client_phone); tst++; } fclose(viewing); if (tst==0) { system("cls"); printf("\nNO RECORDS!!\n");} view_list_inv: printf("\n\nEnter 1 to go to the main menu and 0 to exit:"); scanf("%d",&exits); system("cls"); if (exits==1) menu(); else if(exits==0) close(); else { printf("\nInvalid!\a"); goto view_list_inv; }
}

This function is for the update records of clients

In the code given below, which is for the function to update records information of clients.

void update(void)
{
int options,tst=0;
FILE oldrecord,newrecord;
oldrecord=fopen("record.dat","r");
newrecord=fopen("new.dat","w");
printf("\nEnter the account no. of the customer whose info you want to change:"); scanf("%d",&updating.account_number); while(fscanf(oldrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&adding.account_number,adding.client_name,&adding.client_dob.mm,&adding.client_dob.dd,&adding.client_dob.yy,&adding.client_age,adding.client_address,adding.client_citizenship,&adding.client_phone,adding.client_account_type,&adding.client_amount,&adding.client_deposit.mm,&adding.client_deposit.dd,&adding.client_deposit.yy)!=EOF) { if (adding.account_number==updating.account_number) { tst=1; printf("\nWhich information do you want to change?\n1.Address\n2.Phone\n\nEnter your choice(1 for address and 2 for phone):"); scanf("%d",&options); system("cls"); if(options==1) {printf("Enter the new address:"); scanf("%s",updating.client_address); fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,updating.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); system("cls"); printf("Changes saved!"); } else if(options==2) { printf("Enter the new phone number:"); scanf("%lf",&updating.client_phone); fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,updating.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); system("cls"); printf("Changes saved!"); } } else fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); } fclose(oldrecord); fclose(newrecord); remove("record.dat"); rename("new.dat","record.dat");
if(tst!=1)
{ system("cls");
printf("\nRecord not found!!\a\a\a");
edit_inv:
printf("\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
scanf("%d",&exits);
system("cls");
if (exits==1)
menu(); else if (exits==2) close(); else if(exits==0) update(); else {printf("\nInvalid!\a"); goto edit_inv;} } else {printf("\n\n\nEnter 1 to go to the main menu and 0 to exit:"); scanf("%d",&exits); system("cls"); if (exits==1) menu(); else close(); }
}

This function is for the transaction of clients

In the code given below, which is for the function to transact the clients to withdraw or to deposit amount.

void transact(void)
{ int options,tst=0;
FILE oldrecord,newrecord;
oldrecord=fopen("record.dat","r");
newrecord=fopen("new.dat","w");
printf("Enter the account no. of the Client:"); scanf("%d",&trans.account_number); while (fscanf(oldrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d",&adding.account_number,adding.client_name,&adding.client_dob.mm,&adding.client_dob.dd,&adding.client_dob.yy,&adding.client_age,adding.client_address,adding.client_citizenship,&adding.client_phone,adding.client_account_type,&adding.client_amount,&adding.client_deposit.mm,&adding.client_deposit.dd,&adding.client_deposit.yy)!=EOF)
{
if(adding.account_number==trans.account_number) { tst=1; if(strcmpi(adding.client_account_type,"fixed1")==0||strcmpi(adding.client_account_type,"fixed2")==0||strcmpi(adding.client_account_type,"fixed3")==0) { printf("\a\a\a\n\nYOU CANNOT DEPOSIT OR WITHDRAW CASH IN FIXED ACCOUNTS!!!!!"); fordelay(1000000000); system("cls"); menu(); } printf("\n\nDo you want to\n1.Deposit\n2.Withdraw?\n\nEnter your choice(1 for deposit and 2 for withdraw):"); scanf("%d",&options); if (options==1) { printf("Enter the amount you want to deposit:P "); scanf("%f",&trans.client_amount); adding.client_amount+=trans.client_amount; fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); printf("\n\nDeposited successfully!"); } else { printf("Enter the amount you want to withdraw:P "); scanf("%f",&trans.client_amount); adding.client_amount-=trans.client_amount; fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); printf("\n\nWithdrawn successfully!"); } } else { fprintf(newrecord,"%d %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n",adding.account_number,adding.client_name,adding.client_dob.mm,adding.client_dob.dd,adding.client_dob.yy,adding.client_age,adding.client_address,adding.client_citizenship,adding.client_phone,adding.client_account_type,adding.client_amount,adding.client_deposit.mm,adding.client_deposit.dd,adding.client_deposit.yy); }
}
fclose(oldrecord);
fclose(newrecord);
remove("record.dat");
rename("new.dat","record.dat");
if(tst!=1)
{
printf("\n\nRecord not found!!");
transact_invalid:
printf("\n\n\nEnter 0 to try again,1 to return to main menu and 2 to exit:");
scanf("%d",&exits);
system("cls");
if (exits==0)
transact();
else if (exits==1)
menu();
else if (exits==2)
close();
else
{
printf("\nInvalid!");
goto transact_invalid;
}
}
else
{
printf("\nEnter 1 to go to the main menu and 0 to exit:");
scanf("%d",&exits);
system("cls");
if (exits==1)
menu();
else
close();
}
}

Downloadable Source Code

Summary

That’s how you create a Bank Management System project in C with Source Code in your projects.

You can always expand and try different ways of implementing the Bank System in C in your C projects.

C is a powerful general-purpose programming language.

It can be used to develop software like operating systems, databases, compilers, and so on. 

C programming is an excellent language to learn to program for beginners.

Our C tutorials will guide you to learn C programming one step at a time.

In this Mini Project for Bank Management in C with Source Code is free to download and It is easy to understand and manipulate this project and use it for education purposes only.

Plus, read or visit the other interesting languages used in bank management system.

Inquiries

If you have any questions or suggestions about Bank Management System in C with Source Code, please feel free to leave a comment below.

Leave a Comment