cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Question about switch case
Question about switch case
Apr 9, 2020 at 10:36am UTC
mbahgito90
(3)
Example program :
int main(){
char menu;
formmenu :
cout << "1. 38° Fever in the past 14 days" << endl;
cin >> menu;
cout << endl;
switch (menu)
{
case '1' :
cout << "another symptoms?" << endl;
goto formmenu;
break;
Is there a way that if I select no 1, for example, two times, it will automatically display another output? (so first time it will go back to the menu, and the second time it will display an output) *sorry, im still new to programming
Last edited on
Apr 9, 2020 at 10:44am UTC
Apr 9, 2020 at 10:50am UTC
MikeyBoy
(5631)
Why would you use the same number on the menu to do two different things? That would seem to be bad design to me.
Can you explain more clearly how you want your program to behave?
Topic archived. No new replies allowed.