problem in while language

You mean nest an if statement within a while loop? Sure.