Exemplo de menu em linguagem c#
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main()
{
int opcao;
begin:
opcao=0;
system ("CLS"); printf ("\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n"); printf ("\xBA \tMENU DE OPCOES \xBA\n"); printf ("\xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBc\n\n"); printf ("\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n"); printf ("\xBA 1- EXERCICIO I \xBA\n"); printf ("\xBA 2- EXERCICIO II \xBA\n"); printf ("\xBA 3- EXERCICIO III \xBA\n"); printf ("\xBA 4- EXERCICIO IV \xBA\n"); printf ("\xBA 5- EXERCICIO V \xBA\n"); printf ("\xBA 6- EXERCICIO VI \xBA\n"); printf ("\xBA 7- EXERCICIO VII \xBA\n"); printf ("\xBA 8- EXERCICIO VIII\xBA\n"); printf ("\xBA 9- EXERCICIO IX \xBA\n"); printf ("\xBA 10- EXERCICIO X \xBA\n"); printf ("\xBA 11- SAIR \xBA\n"); printf ("\xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\n\n"); printf ("Digite a opcao seleccionada: "); scanf ("%d",&opcao);
if (opcao >= 12 || opcao <= 0){ printf ("\t\n\nERRO DIGITE UMA OPCAO VALIDA! <Para voltar tecle ENTER>\n\n"); getch (); fflush(stdin); goto begin;}
switch (opcao) { case 1: { system ("cls"); printf ("\tEXERCICIO I\n"); printf ("\t\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\n\n"); printf ("Construa um programa que calcule a area de um triangulo.\n"); printf ("Lembre-se de que, para realizar esse calculo, e necessario utilizar a formula:\n"); printf ("\n\nArea = (base * altura /2).\n"); printf ("\n\n\nDigite uma tecla para