If the number input isn’t one that you check (1 to 5) then you hit:
else if (a == 1) {
std::cout << "\n";
return 1;
}
which will enter the if
(because a
is 1), print a new line and return
from main
ending your run.
solved Me not understanding do while loops [closed]