August 1st, 2003, 02:13 AM
problem in displaying the corret and wrong answer in a c program
please help me in making a program that will display the correct and wrong answer in 10 simple math problem .
example is :
no. of correct:5
no. of wrong:5
note the user will answer the problem!
thank you !
August 1st, 2003, 03:15 AM
1) put the correct answers in an array called something like "key"
2) read in the user's answers into an array called "answers"
3) use a for loop to step through the key array and check if key[i] == answer[i]. if it does increment a variable called correct by one, if not increment a variable called wrong by one.
4) When the for loop ends display the variable correct and the variable wrong.
Last edited by 7stud; August 1st, 2003 at 03:17 AM.