#include<iostream.h>
int main()
{
cout<<"*************Welcome************\n\n";
int pass;
int option;
int balance=50000;
int withdrawal;
int deposit;
cout<<"Please Enter Your Password:";
for (int i=0;i<3;i++)
{
cin>>pass;
cout<<"\n\n";
if(pass==2468)
{
cout<<"**Choose an Option**\n\n";
cout<<"1. Balance Inquiry\n";
cout<<"2. Withdrawal\n";
cout<<"3. Deposit\n";
cout<<"4. Mobile Refill\n";
cout<<"5. Exit\n";
cout<<"Enter Option:";
cin>>option;
switch(option)
{
case 1:
cout<<"\t **Balance Inquiry**\n";
cout<<"Your Current Balance is:"<<balance<<endl;
break;
case 2:
cout<<"\t **Withdrawl**\n";
cout<<"Enter amount:";
cin>>withdrawal;
balance=balance-withdrawal;
cout<<"Your remaining balance is $"<<balance<<endl;
continue;
case 3:
cout<<"\t **Deposit**\n";
cout<<"Enter amount: $";
cin>>deposit;
balance = balance + deposit;
cout<<"Your new balance is $"<<balance<<endl;
continue;
case 4:
cout<<"\t **Mobile Refill**\n";
cout<<"\t **Deposit**\n";
break;
default:
cout<<"This is an invalid option. \n";
}
}
else
{
cout<<"Incorrect Password,Please Try Again :";
}
}
cout<<"You Entered The Wrong Password More Than 3 Times!.Good Bye";
}
I am unable to get out of the loop,.eg if i choose i get the right password and enter the loop, following an option, i cannot choose another option.Please help