Im trying to write out the code for these while loops, can you show me how to do these.

1) “while counter is less than 50, then increase it by one”

2) “while x is less than y and is not zero, divide x in half”

attempt at solution:

1) while (counter<50)

{

counter++;

}

2) while (x<y && x!=0)

{

x=x/2;

}