i have been told to use a do while loop instead of a goto statment,
here is a code i made to try the do while loop,
int main()
{
int A = 0;
cout << "Enter a number from 1 - 5 " ;
cin >> A;
do
{
cout << "your number was 1";
cout << endl;
}while (A == 1);
do
{
cout << "your number was 2";
}while (A == 2);
do
{
cout << "your number was 3";
}while (A == 3);
do
{
cout << "your number was 4";
}while (A == 4);
do
{
cout << "your number was 5";
}while (A == 5);
but when i run this program it goes through every loop
i understand that even if it did work properly it would be a infinate loop, so next question is how do i exit the do while loop?