15,906,463 members
See more:
this is multiple quiz, when user enter answer at end of the quiz if more than 15 wrong
Show
```Failed with (..) incorrect answer
Incorrect question: 14,15,12,.....,```

but what i have post only shows
`Failed with 7 incorrect answer`

What I have tried:

C#
```int[] usercount = new int[20];
int count = 0;
{
{
}
else
{
}
count++;
}
{
Console.WriteLine("Passed with {0} correct answers! You are amazing!",
}
else
{
}```
Posted
Updated 8-Apr-18 14:12pm
v2

## Solution 1

The first thing you need to do is store a list of which questions he got wrong ... you don't do anything with that at present, so have a think about what collections you know how to use, and decide what you want to store them in.

Then use that inside the `if` block so you can print it later.

But... this is your homework, and we don't know what you have been taught s far, so I'll give you no code!

Give it a try, and see how far you get - this really isn't complicated if you think about it for a few minutes.

Member 13757304 8-Apr-18 16:52pm
i try but not working
OriginalGriff 8-Apr-18 17:38pm
What did you try?
How is it "not working"?
What does it do that you didn't expect, or not do that you did?
What did you do you find out why?
Show the relevent code fragment.

## Solution 2

Quote:
but what i have post only shows Failed with 7 incorrect answer

Because the part that show the list of incorrect answers is missing in your code.
1) you need to choose where to add the code for list of incorrect answers.
2) Just as you checked each answer to count correct and incorrect, you have to check them again and print the number of each incorrect ones.

C#
`foreach (char answer in useranswers)`

Advice: Never use a `for each` loop to scan 2 arrays, it only makes code harder to read and do not save the counter of the loop, you handle it by yourself manually.
In this case a `for` loop will make obvious that you are matching the same positions of both variables.