do while
switch
int main() { char c; do { // ask the use to insert a character, assing it to 'c' switch(c) { case 'a': // ask the user to input the side of the square, compute the perimeter and output it break; case 'b': // ask the user to input the side of the square, compute the area and output it break; default: // if (c != 'q') warn the user about incorrect input break; } } while ( c != 'q'); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)