I have this loop i made and just cant figure out why it wont stop running..can some one help ..I just need it to say what decision i made then stop...or display the ol' press any key to exit app..God Bless..
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
std::cout << "How old are you: " << std::endl;
std::cout << "\n";
std::cout << "[1]. add" << std::endl;
std::cout << "[2]. subtract" << std::endl;
std::cout << "[3]. divide" << std::endl;
std::cout << "[4]. multiply" << std::endl;
int ages[4];
ages[0]='1';
ages[1]='2';
ages[2]='3';
ages[3]='4';
do {
std::cin >> ages[4];
std::cin.get();
if (ages[4] == 1)
std::cout << "You choose [add]..." << std::endl;
else if (ages[4] == 2)
std::cout << "You choose [subtract]..." << std::endl;
else if (ages[4] == 3)
std::cout << "You choose [divide]..." << std::endl;
else if (ages[4] == 4)
std::cout << "You choose [multiply]..." << std::endl;
else
std::cout << "Sorry!!! choose one of the four listed above!!!" << std::endl;
}
while (ages[4] != 1,2,3,4);
}