so the results are how many times items were successfully read. and the only reason it is unable to read the letter is because of the format specifier?
What does the documentation say it returns? What does it return in your program?
Read the documentation that both firedraco and I pointed you to (and that you failed to comprehend) and ask yourself "is scanf() going to be able to successfully convert the letter my teacher just entered to the integer I asked it to input?" The answer to that question should tell you what scanf() returns.
but thats what im saying i DONT want it to convert the letter to a number. my program ask's for a number input not a letter input. my teacher is putting in a letter to send it on a infinite loop. in other words she is trying to mess the program up somehow i know %d is for numbers and i know that %s is for letters but how do i stop the infinite loop when she enters a letter(which isnt surposed to be in there)
but mine is in a while with a switch statment so when one is entered in mine it goes to the 1st case but if a is entered it goes on a infinite loop. how can i stop the loop?
Ugh. After his code executes, what is result equal to, and item equal to, if he inputs 1? And, separately, what is result equal to, and item equal to, if he inputs the letter A? Run it through a debugger or something and see, or use the reference section of this site as has been suggested.