It is obvious that the numbers on the screen will be displayed sequentially. It remains only to find out what number will be displayed the first, and witch one the last.
Since at each test the condition of the variable x increases then 1 will be the first number to be printed.
At the last iteration of the condition x++ > 5 must become true. Since the value of the expression x++ is the original value of the variable, it will be at x = 6. But on the screen will be displayed a new larger value, ie, 7.
We'll get the answer: 1234567.