Answer:
the variable num is not declared so the compiler doesn't define it.
add int before num:
int num = 1;
while (num < 9)
{
cout << num;
num = num - 1;
}
now the code will run but it won't stop as it will never break the condition (num < 9).