Since x
and y
have been declared as volatile, the programmer expects that they will be changed from outside the program.
In that case, your code will remain in the loop
while(x>y);
and will return the value x-y
after the values are changed from outside such that x <= y
. The exact reason why this is written can be guessed after you tell us more about your code and where you saw it. The while
loop in this case is a waiting technique for some other event to occur.