// functions_lab1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream.h" int x, y; char choice; void add ( ) { int total; total = x + y; cout << total << endl; } void subtract () { cout << "subtract " << endl; } void multiply () { cout << "multiply" << endl; } int _tmain(int argc, _TCHAR* argv[]) { while (choice != 'x') { cout << " Menu " << endl; cout << " a. Add " << endl; cout << " b. Subtract " << endl; cout << " c. Multiply " << endl; cout << " x. Exit " << endl; cout << "enter your menu choice: " << endl; cin >> choice; if (choice != 'x') { cout << "enter two numbers: " << endl; cin >> x >> y; } if (choice == 'a') add(); else if (choice == 'b') subtract(); else if (choice == 'c') multiply(); } return 0; }