I want know how this code printed out 21 after the while loop? [closed]

  c++

I just wanna know how the code printed 21 after the while loop?
I was expecting this program to print out 18. Explain
The code is down below

int x = 0; 
int y = 5;
while(x < 2){
   x++;
   y += 8;
}
cout << y;

(Sorry if I didn’t really specify this question more, I’m just a beginner)

Source: Windows Questions C++

LEAVE A COMMENT