0% found this document useful (0 votes)
8 views

Main Project

The document contains code for an ATM machine program. It prompts the user to insert their card and enter their PIN. If the correct PIN is entered, the user can change their PIN, withdraw or deposit money, or check their account balance and transaction history. The program uses logic and input validation to perform the selected ATM functions.

Uploaded by

nihanth
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Main Project

The document contains code for an ATM machine program. It prompts the user to insert their card and enter their PIN. If the correct PIN is entered, the user can change their PIN, withdraw or deposit money, or check their account balance and transaction history. The program uses logic and input validation to perform the selected ATM functions.

Uploaded by

nihanth
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#include<stdio.

h>
int main()
{
int i,j,k,l,f,g,n,p,q,s,v;
float m=15000,o;
printf("Insert your ATM card\n");
printf("Enter pin : ");
scanf("%d",&i);
if(i==2587)
{
printf("Enter 1 to Change password\n");
printf("Enter 2 to Withdrawl money\n");
printf("Enter 3 to get mini statement\n");
printf("Enter 4 to deposit money\n");
scanf("%d",&j);
while(j!=5){

if(j==1)
{
printf("Please enter current pin\n");
scanf("%d",&k);
if(k==2587)
{
printf("Enter new pin\n");
scanf("%d",&l);
printf("Confirm new pin\n");
scanf("%d",&f);

if(l==f)
{
i=f;
printf("Password changed successfully");
}
else
{
printf("Check your pin again");
}
}
else
{
printf("Wrong pin,Check your pin again");
}
printf("Enter 1 to Change password\n");
printf("Enter 2 to Withdrawl money\n");
printf("Enter 3 to get mini statement\n");
printf("Enter 4 to deposit money\n");
printf("Enter 5 to quit\n");
scanf("%d",&j);
}
if(j==2)
{
printf("Enter amount for withdrawl\n");
printf("Enter 1 to withdrawl amount from current account\n");
printf("Enter 2 to withdrawl amount from savings account\n");
scanf("%d",&g);
if(g==1)
{
printf("Enter amount");
scanf("%d",&n);
p=m-n;
if(p<500)
{
printf("Low balance\n");
printf("Balance amount: %d\n",p);
}
else
{
printf("collect cash\n");
printf("Balance amount: %d\n",p);
}
}
if(g==2)
{
printf("Enter amount");
scanf("%d",&q);
s=m-q;
if(s<500)
{
printf("Low balance\n");
printf("Balance amount: %d\n",s);
}
else
{
printf("collect cash\n");
printf("Balance amount: %d\n",s);
}
}

else
{
printf("Enter correct value\n");
}} printf("Enter 1 to Change password\n");
printf("Enter 2 to Withdrawl money\n");
printf("Enter 3 to get mini statement\n");
printf("Enter 4 to deposit money\n");
printf("Enter 5 to quit\n");
scanf("%d",&j);
if(j==3)
{
printf("Currently we had no histories of your account\n");
printf("Account number Account name Balance\n");
printf("78965klj12 Nihanth 15000\n");
printf("Enter 1 to Change password\n");
printf("Enter 2 to Withdrawl money\n");
printf("Enter 3 to get mini statement\n");
printf("Enter 4 to deposit money\n");
printf("Enter 5 to quit\n");
scanf("%d",&j);
}
if(j==4)
{
printf("Please enter amount");
scanf("%f",&o);
v=m+o;
printf("Current balance in your account: %d",v);
printf("Enter 1 to Change password\n");
printf("Enter 2 to Withdrawl money\n");
printf("Enter 3 to get mini statement\n");
printf("Enter 4 to deposit money\n");
printf("Enter 5 to quit\n");
scanf("%d",&j);
}

}}
else
{
printf("Please enter correct pin");
}

You might also like