Basically, I made a small calculator. It does the PEMDAS and factorials. Part of my code is here:
#include "stdafx.h"
#include "iostream"
#include "stdio.h"
#include "math.h"
using namespace std;
short MENU (void);
void raiz (void);
void suma (void);
etc.....
int main ()
{
short OPC;
OPC=MENU ();
do
{
switch (OPC)
{
case 1: raiz();
break;
case 2: suma();
break;
etc.....
case 8: break;
default: cout<<"\n Seleccion Erronea. \n ";
OPC=MENU();
}
}
while ((OPC>8) || (OPC<1));
cout<<"\n\n\t\t ";
system ("pause");
return 0;
}
After that, are the modules themselves (short MENU, void suma, etc) which do each process. Nevertheless, I want that if I selected the suma (Addition) and finished with it, the program would send me back to the menu and keep on going until I select case 8 (Quit).
Help?