I think you need to work your algorithm in line 29 to line 48.

Check if your program enters the loop in line 32 (conditional expression). Do you need the value of the argument count variable...