Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char option[5];
- puts("\nEscolha um animal:\tMacaco\tCobra\tLeao.");
- printf("Agora responda-me, o animal escolhido e mamifero? [Sim/Nao] ");
- fgets(option,5,stdin);
- if(strcmp(option,"sim")>0)
- {
- printf("O animal vive na savana? [Sim/Nao] ");
- fgets(option,5,stdin);
- if(!strcmp("sim",option)>0)
- {
- puts("Voce escolheu \"Leao\"");
- }
- else
- {
- puts("Voce escolheu \"Macaco\"");
- }
- }
- else
- {
- puts("Voce pensou em \"Cobra\"");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement