So basically the code is first off initializing x = 1. So now variable x is stored as 1 in memory. It then executes the while statement which is saying, while x is less than or equal to 10, print "Hey" on the screen and then add +1 to x's value. It will keep repeating this till x's value has reached 10, then the program will end. What you will see on your screen is "hey" a bunch of times rather than seeing what is happening with 1.
Try building and running this code to help you understand. It will show you what is happening with x. I suggest typing in different integer values and see what happens. It's good to learn what will happen to a program when you enter different values. That's how you'll learn more. Goodluck.