Introduction:-
C is one of the most
popular general-purpose programming languages. C language has been designed and
developed by Dennis Ritchie at Bell Laboratories, USA, in 1972. Several
important concepts of c are drawn form ‘Basic combined programming language’
and ‘B’ language.C language is a middle-level language.It does not mean that C
is not powerful and rugged for writing programs like in Fortan and Pascal.
About Cpp:
C++ is a general-purpose programming
language created by Bjarne Stroustrup as an extension of the C programming
language or "C with Classes".
The language has expanded significantly over time, and modern C++ has
object-oriented, generic, and functional features in addition to facilities for
lowlevel memory manipulation. It is almost always implemented as a compiled
language, and many vendors provide C++ compilers, including the Free Software
Foundation, Microsoft, Intel, and IBM, so it is available on many platforms.
About the
organization: iSMRITI is India's leading company in Artificial Intelligence,
Internet of Things and its application for positive impact. Being the
Brainchild of faculty and alumni from various IITs, iSMRITI does Consultancy,
Product Development and Educational Workshops. Our company is based at IIT
Kanpur with a group of passionate and experienced professionals carrying a rich
intellectual background from world-class engineering institutions. We focus on
providing technical expertise in various cutting edge fields involving the
Internet of Things(IoT), Artificial Intelligence(AI) and Robotics.
Description
of project:
A sample C
programming code for real time Bank application program is given below. This
program will perform all below operations.
1. Creating new account – To create a new
account
2. Cash Deposit – To Deposit some amount in
newly created account
3. Cash withdrawal – To Withdraw some amount
from your account
4. Display Account information – It will
display all informations of the existing accounts
5. Log out
6. Clearing the output screen and display
available options.
Project using
a method in c programming-
1. Basic programming
using input and output operators and expressions.
2. programming
using if and if-else.
3. Programming
using looping-for, while, do-while.
4. Use of
switch and break.
5. Programming
using Functions (Defining and calling a function).
6.
Programming using a string.
7.
Programming using a structure.
Code-
#include<stdio.h>
#include<conio.h>
#include<string.h>
void
creation();
void
deposit();
void
withdraw();
void
balance();
int a=0,n =
101;
struct bank
{
int no;
char name[20];
float balance;
float deposit;
}s[20];
void main()
{
int ch;
while(ch)
{
printf("\n*********************");
printf("\n
BANKING ");
printf("\n*********************");
printf("\n1-Creation");
printf("\n2-Deposit");
printf("\n3-Withdraw");
printf("\n4-Balance Enquiry");
printf("\n5-Exit");
printf("\nEnter your choice");
scanf("%d",&ch);
switch(ch)
{
case 1: creation();
break;
case 2: deposit();
break;
case 3: withdraw();
break;
case 4: balance();
break;
defalut: printf("Enter 1-5 only");
}
}
}
void creation()
{
printf("\n*************************************");
printf("\n ACCOUNT
CREATION ");
printf("\n*************************************\n");
char username[20];
char userpwd[8];
int i;
printf("\nEnter your username : ");
scanf("%s",username);
printf("\nEnter your password : ");
for(i=0;i<8;i++)
{
userpwd[i]=getch();
printf("*");
}
userpwd[i]='\0';
printf("\n\nPress any key to
continue");
getch();
if(!strcmp(username,"neeraj")
&& !strcmp(userpwd,"neeraj12"))
{
printf("\n\nLogged In
Successful\n\n");
printf("\n\n\n Welcome To in
a PUNJAB NATIONAL BANK..............\n\n");
printf("\n\n\n what are you
want......\n");
}
else
{
printf("\n\nIncorrect username or
password");
printf("\n\nLogged In
Successful\n\n");
printf("\n\n\n Welcome To in
a PUNJAB NATIONAL BANK..............\n\n");
printf("\n\n\n what are you
want......\n");
}
printf("\nYour Account
Number is :%d",n);
s[a].no = n;
printf("\nEnter your
Name:");
scanf("%s",s[a].name);
char address;
int j,p ;
printf("\nEnter the
address\n",address);
scanf("%s",&address);
printf("enter the your adhar card
number\n");
for(j=0;j<=12;j++)
{
printf("%d",j);
}
printf("\nYour Deposit
is Minimum Rs.500");
s[a].deposit=500;
a++;
n++;
getch();
}
void deposit()
{
int no,i=0,m=0;
float b;
printf("\n*************************************");
printf("\n DEPOSIT
");
printf("\n*************************************");
printf("\nEnter your
Account Number");
scanf("%d",&no);
for(i=0;i<n;i++)
{
if(s[i].no == no)
m = i;
}
if(s[m].no == no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].deposit);
printf("\n How Much Deposited Now:");
scanf("%f",&b);
s[m].deposit+=b;
printf("\nDeposit Amount is :%f",s[m].deposit);
getch();
}
else
{
printf("\nACCOUNT NUMBER IS INVALID");
getch();
}
}
void withdraw()
{
int no,i=0,m=0;
float b;
printf("\n*************************************");
printf("\n WITHDRAW
");
printf("\n*************************************");
printf("\nEnter your
Account Number");
scanf("%d",&no);
for(i=0;i<n;i++)
{
if(s[i].no == no)
m = i;
}
if(s[m].no == no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].deposit);
printf("\n How Much Withdraw Now:");
printf("\n
please collect the your money...");
scanf("%f",&b);
if(s[m].deposit<b+500)
{
printf("\nCANNOT
WITHDRAW YOUR ACCOUNT HAS MINIMUM BALANCE");
getch();
}
else
{
s[m].deposit-=b;
printf("\nThe Balance Amount is:%f",s[m].deposit);
}
}
else
{
printf("INVALID");
getch();
}
getch();
}
void balance()
{
int no,i=0,m=0;
float b;
printf("\n*************************************");
printf("\n BALANCE ENQUIRY ");
printf("\n*************************************");
printf("\nEnter your
Account Number");
scanf("%d",&no);
for(i=0;i<n;i++)
{
if(s[n].no == no)
m = i;
}
if(s[m].no==no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].deposit);
getch();
}
else
{
printf("INVALID");
getch();
}
}
Output-
0 Comments