Okay, so I need to do a huck finn project and I decided I'd show off some cool computer programming knowledge by making a huck finn quiz in C, but, I believe i have everything right, no errors pop up when I compile it, but as soon as I put in my name it shows all the questions and the closes, any help? heres the script. also, i just found out if i dont use a space when i first enter my name, it wont skip, but it will only go to question 2, then it will become non responsive and crash, any help?
Code:
#include<stdio.h>
main()
{
char name[30];
int answer;
int score;
int total;
printf("Enter Your Name\n");
scanf("%s", name);
printf("What pair of characters is this story about?\n 1.Tom and Huck\n 2.Huck and Pap\n 3.Jim and Huck\n 4.Pap and Judge Thatcher\n");
scanf("%d", answer);
if (answer = 3)
score + 1;
printf("What River did our main characters travel on?\n 1.Ohio\n2.Arkansas\n3.Mississippi\n4.Wisconsin");
scanf("%d", answer);
if (answer = 3)
score + 1;
printf("What was the name of the family that took 'George Jackson' in?\n1.Sheperdsons\n2Grangerfords\n3.Watson\n4.Sawyer");
scanf("%d", answer);
if (answer = 2)
score + 1;
printf("Where was Jim's destination?\n1.Cairo\n2.Ohio\n3.Iowa\n4Mississippi");
scanf("%d", answer);
if (answer = 1)
score + 1;
printf("Who was declaired dead at the end of the book?\n1.Jim\n2.Huck\n3.Pap\n4Tom\n");
scanf("%d", answer);
if (answer = 3)
score + 1;
printf("%s got %d out of 5",name, score);
getchar();
getchar();
}