How I can create a submenu in menu? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How I can create a submenu in menu?

menu

24th Nov 2016, 11:19 PM
Madalina Niculescu
Madalina Niculescu - avatar
2 Answers
0
Your question is not really clear, but I guess you are talking about a sub case of an if statement. You just have to add an if statement inside of another if statement. #include <iostream> using namespace std; int main() { int firstVar = 0; int secondVar = 0; cin >> firstVar; cin >> secondVar; if (firstVar == 0) { if (secondVar == 0) { cout << "Both vars are 0" << endl; } else { cout << "Just the first var is 0" << endl; } } }
30th Nov 2016, 11:50 AM
David Barzi
David Barzi - avatar
0
Tks!But I want to know how I can create a down submenu in menu.I must to do a new menu in case?If i have an option (in first case) and i want to access her to introduce another option...this is what i ask 😊
2nd Dec 2016, 9:59 AM
Madalina Niculescu
Madalina Niculescu - avatar