Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- char opcao;
- do{
- printf("\n");
- printf("Deseja sair do programa? [s/n]: ");
- opcao = getchar(); fflush(stdin);
- switch(opcao){
- case 'N':
- case 'n':
- system("cls");
- main();
- case 'S':
- case 's':
- return 0;
- }
- printf("Opcao invalida.\n");
- }while(opcao != 'N' || opcao != 'n' || opcao != 'S' || opcao != 's');
- }
Advertisement
Add Comment
Please, Sign In to add comment