First calculator in c++, tips for optimisation
You should avoid using namespace std.

The code in the prompt function is not indented.

You should avoid using endl unless absolutely necessary (use a \n instead).  endl will flush the output buffer which can be a big performance hit.

You don't have a break statement for the default case of your switch statement.  While not required here, it can lead to problems in the future if additional cases are added after the default and the break is not added.

Declaring uninitialized variables within a switch statement is legal, but can lead to confusion.  Usually when variables are declared under a case, the code of the case is enclosed within { curly brackets }.  For example, the a and b variables, which are used in most of the cases, could be declared before the switch.