Your program is completely wrong.. Looks like you are confused with the || (or) stuff in the while loop.. your program would run into an infinite loop... the or has to be substituted by and &&.. though in normal english it may sound logical.. in programming it has a different meaning.. the first condition is always checked and if it is true the next condition is never checked...
A good way to think of it (or at least the way I think of it), is that when you do A && B ("A and B"), the loop or if statement only executes if A and B are both true. With A || B ("A or B"), the loop/if only executes if either A or B is true (or if both are true!).