-2
Save save everyone, everything jewel with you? I hope so, I have this code on C
he’s okay, but I’m trying to implement more questions and I can’t.
Follows the code:
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
main()
{
int n,pts=0;
char resposta[100];
printf("====Jogo das Tres Pista====\n\n");
printf("1-Inicia jogo\n\n");
printf("2-Creditos \n\n");
printf("3-sair\n\n");
printf("Digite sua Opcao");
scanf("%i",&n);
system("cls");
switch(n)
{
case 1:
printf ("Torres: ");
scanf ("%s", &resposta);
printf("PALAVRA DIGITADA: %s\n\n", resposta);
if(!strcmp(resposta, "EUA")||!strcmp(resposta, "Eua")||!strcmp(resposta, "eua")||!strcmp(resposta, "EstadoUnido")){
printf("Resposta Certa!, 10 pts!\n"); pts+=10;
return 0;
}else{
printf("\n VOCE ERRO A PROXIMA DICA E DOLAR!, 0 pts \n\n!\n");
}
printf ("DOLAR: ");
scanf ("%s", &resposta);
printf("PALAVRA DIGITADA: %s", resposta);
if(!strcmp(resposta, "EUA")||!strcmp(resposta, "Eua")||!strcmp(resposta, "eua")||!strcmp(resposta, "EstadoUnido")){
printf("Resposta Certa!, 5 pts!\n"); pts+=5;
return 0;
}else{
printf("\n VOCE ERRO A PROXIMA DICA E HOLLYWOOD!, 0 pts \n\n!\n");
}
printf ("HOLLYWOOD!: ");
scanf ("%s", &resposta);
printf("PALAVRA DIGITADA: %s", resposta);
if(!strcmp(resposta, "EUA")||!strcmp(resposta, "Eua")||!strcmp(resposta, "eua")||!strcmp(resposta, "EstadoUnido")){
printf("Resposta Certa!, 2 pts!\n"); pts+=2;
}else{
printf("\n VOCE ERRO RESPOSTA CERTA SERIA EUA VAMOS EM FRENTE!, 0 pts \n\n!\n");
}
system("pause");
system("cls");
case 2:
printf("*** CREDITOS ***\n\n BY: <<< GEOVANI >>>\n\n");
break;
case 3:
printf("*** ACABOU O JOGO ***\n\n");
break;
default:
printf("*** Obrigado por usa nosso sistema ***\n");
}
}
someone can tell me how do I go to next question without closing the program
What makes it end is
return 0;
that has in theif
of the answer. Just withdraw even, alias I wonder until what was your intention in putting thisreturn 0;
within theif
?– Isac