Question: if and while statements

Hi,

statements

and

works separately, but i can't but it together, like

Where I do mistake?

Please Wait...