Mr. Brandon sir ... What I would like for you to do is see
{ } as if it was a page that represents a form you are making to be filled out. That means anything you are asking for must go on that page which is going to be between the
{ }
Example
{ How long have you been employed on your current job? }
If what you are trying to say goes outside the page
{ } How long have you been employed on your current job? then you are probably writing on the table or something and your form will remain with nothing on it.
Next I would like for you to see the while loop as the title of your form which conveys the purpose of the form.
So now we have the following:
while() <- This is your title
{ } <- This is your empty page
Now drawing back on the context of your problem... What you are really trying to get out of this is -- If the user enter a value less than 0 or more than 250000 then you are not satisfied with the answers supplied on the form, so you supply a copy of the form to see what the new response will be until you are satisfied with the response...
Now in terms of your problem we get the following:
while(salary < 0 || salary > 250000) <- Title: If you say your salary is less than zero
or it is more than 25000 then I know you are lying and I wont accept your answer so you better answer correctly
{ <- Start of your page
salary = /* code for user to enter salary goes here */ <- Note: If you enter contrary to the title of this form you will be supplied a new form (So this loop will happen over and over until the instructions in the title is met)
} <- End of the page
And there you have it ... This logic can be supplied to any looping code once you make sure you are checking for the correct range of values or input within the condition of the loop... Now go try it pal ... I know you can do it