Advertisement
LincolnArantes

MENU EM C

Feb 26th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.05 KB | None | 0 0
  1. //compilador on line: https://repl.it/repls/SilkyWigglyNaturallanguage
  2. #include<stdio.h>
  3.  
  4. void cadastro()
  5. {
  6.     printf("CADASTRO!\n");
  7. }
  8.  
  9. void consulta()
  10. {
  11.     printf("CONSULTA\n");
  12. }
  13.  
  14. void relatorio()
  15. {
  16.     printf("RELATORIO!\n");
  17. }
  18.  
  19. void sair()
  20. {
  21.     printf("Ja vai??? Nao! Nao! Espere! Naa...\n");
  22. }
  23.  
  24.  
  25. int main()
  26. {
  27.     int continuar=1;
  28.  
  29.     do
  30.     {
  31.         printf("\n\MENU\n\n");
  32.         printf("1. CADASTRO\n");
  33.         printf("2. CONSULTA\n");
  34.         printf("3. RELATORIO\n");
  35.         printf("0. Sair\n");
  36.  
  37.         scanf("%d", &continuar);
  38.         system("cls || clear");
  39.  
  40.         switch(continuar)
  41.         {
  42.             case 1:
  43.                 cadastro();
  44.                 break;
  45.  
  46.             case 2:
  47.                 consulta();
  48.                 break;
  49.  
  50.             case 3:
  51.                 relatorio();
  52.                 break;
  53.  
  54.             case 0:
  55.                 sair();
  56.                 break;
  57.  
  58.             default:
  59.                 printf("Digite uma opcao valida\n");
  60.         }
  61.     } while(continuar);
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement