Code:
#include <stdio.h>
#include <string.h>
int main( ){
int num=0;
char user[BUFSIZ];
const char answer[][16] =
{
"Bowling\n",
"Memphis\n",
"Danmarksstrædet\n",
"Alderney\n",
"Aorta\n",
"Århus\n",
"end\n",
};
do{
fgets(user,BUFSIZ,stdin);
if(strcmpi(user,answer[num])==0){
printf("correct\n");
}
else{
printf("wrong\n");
}
num++;
}
while(strcmp(answer[num],"end\n")!=0);
printf("End of quiz at least no more answers left :-d\n");
return 0;
}
I think this should be enough for now...
Greets,
Ganglylamb.
PS: sorry for any sloppy coding...dont have too much time to pretty-fi anything ...and sry for my previous post i was my mind was set on using a data file with all answers and questions in while at the same doing it the hard -coded way, can sound strange but ive got some strange braincells up here...