Quote Originally Posted by easynhappy View Post
Am getting even more lost.
Did you write this program? If so, then how could you even begin to write it if you couldn't debug it if something goes wrong? I don't get it.

When you wrote the program, you had something in mind, else it would not exist. So now that it is written, where does the program break down? Or is the problem you don't understand what you're doing with this algorithm at all?

I'll restate my first post to you:
But again, you are supposed to debug your own code by using your compiler's debugger. You should be single-stepping through your program and seeing what the values are. You wrote the program, therefore you should be debugging your own code.
Regards,

Paul McKenzie