how can i display all the account numbers that have been entered.
it only shows the last account number entered, not any before it.
heres the code-
#include <iostream>
using namespace std;
int main()
{
double deposit;
double previous;
double newtotal;
double withdraw;
int total;
int number;
int res;
total = 0;
cout << " WELCOME TO MSIBANK " << endl;
cout << endl;
cout << "Enter 1 to process an account or 0 to stop" << endl;
cin >> res;
while(res == 1)
{
cout << "Enter account number please" << endl;
cin >> number;
cout << " Enter present amount in account: " << endl;
cin >> previous;
cout << " Enter deposit amount: " << endl;
cin >> deposit;
cout << "Enter withdraw amount: " << endl;
cin >> withdraw;
newtotal = previous - withdraw + deposit;
cout << " Previous total: " << previous << endl;
cout << " Deposit amount: " << deposit << endl;
cout << " Withdraw amount: " << withdraw << endl;
cout << endl << endl;
cout << "--------------------------------------------------" << endl;
cout << " Present total: " << newtotal << endl;
++total;
cout << "Enter 1 to process an account or 0 to stop" << endl;
cin >> res;
}
cout << "---------------------------------------" << endl;
cout << " Acount numbers: " << number << endl;
cout << " Total accounts processed: " << total;
}