I was trying to make a list of 3 options. If I type '1', option 1 should be printed. What I don't know how to do is print the result.
My attempt so far:
#include <iostream>
using namespace std;
int Menu(int a)
{
cout << "Choose an option: " << endl;
cout << "1.Option 1" << endl;
cout << "2.Option 2" << endl;
cout << "3.Option 3" << endl;
cin >> a;
return a;
}
char printResult()
{
char op;
if (op == '1')
cout << "OPTION 1";
if (op == '2')
cout << "OPTION 2";
if (op == '3')
cout << "OPTION 3";
}
int main()
{
char op;
int a;
Menu(a);
printResult();
}