ATM Banking Project if you have
Just run this code as turboC
- Spoiler:
#include
#include
#define p printf
#define s scanf
char choice;
float bal, depo, withdraw;
/*functions for deposit*/
deposit()
{
p("Enter deposit amount: ");
s("%f",&depo);
bal = bal + depo;
p("%2.f was added to your account..",depo);
getch();
return main();
}
/*functions for withdrawal*/
withdrawal()
{
p("Enter withdrawal amount: ");
s("%f",&withdraw);
if(withdraw>bal)
{
p("\nMaximum withdrawal should be greater than. %2.f ",bal);
getch();
return main();
}
bal = bal - withdraw;
p("balance = %2.f", bal);
getch();
return main();
}
/*functions for balance*/
balance()
{
p("balance: %2.f", bal);
getch();
return main();
}
main()
{
menu:
clrscr();
p("BANKING SYSTEM\n");
p(" a - Deposit\n");
p(" b - Withdrawal\n");
p(" c - Balance Inquiry\n");
p(" d - Exit\n");
p(" Enter your choices: [a-d]");
s("%c",&choice);
if(choice=='a')
{
deposit();
goto menu;
}
if(choice=='b')
{
withdrawal();
goto menu;
}
if(choice=='c')
{
balance();
goto menu;
}
if(choice=='d')
{
return 0;
}
getch();
}
Just run this code as turboC