Well it depends where you get your questions. Are you going to store them in a file or database? Are you going to hard code them? Are you going to randomize them?

Anyways to your latest problem look this:

1. count++; Counter is incremented only once if the user only enter only one set of questions so at the end assuming the user got 9 questions right(countanswer=9) you will have: countanswer = (9/1*100); //what are u actually doing here? getting an average? If so why arent you deviding by the number of questions which is 10?

Another thing, the expression: (countanswer/count*100) is assigned to an integer variable?