How would I write a single expression involving count, x and y that has exactly the same effect as shown (below)?
I'm assuming that you're interested in the following more general situation:


Input: $x,y$.
Initialize $count$ to $0$.
While $y &lt; x$: Increment both $y$ and $count$.


You want to know the values of $x,y,count$ at the end.

If $y \geq x$ to start with, then the while loop never runs, so nothing happens. If $y &lt; x$ (and both are integers), then the loop runs $x - y$ times (why?). At this point you should be able to tell what are the values of $x,y,count$ at the end of the code.