Is there anyway I can display this menu without using cout? My professor said to
ID: 3822651 • Letter: I
Question
Is there anyway I can display this menu without using cout? My professor said to put the menu in a function but do not use cout to display it.
void mainmenu(){
cout << "Welcome to Calculator Project!" << endl;
cout << "*******************************" << endl;
cout << "A) Addition" << endl << "B) Subtraction" << endl << "C) Multiplication" << endl << "D) Division" << endl << "E) Roots (only enter positive number)" << endl <<
"F) Power (only enter positive number)" << endl << "G) Percentage" << endl << "H) Least Common Multiplier" << endl << "I) Greatest Common Divisor" << endl <<
"J) Modulus" << endl << "K) Quit" << endl;
cout << "*******************************" << endl;
}
Explanation / Answer
Hi Friend, you can user many other function to print on console:
fprintf(stdout, "Welcome to Calculator Project! ");
printf( "Welcome to Calculator Project! ")
fwrite(str, sizeof(*str), strlen(str), stdout);
Please let me know in case of more information needed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.