Hello is assigned to the value of age times six... once. As the loop runs, age gets lower and lower, and keeps going to negative-whatever, because your loop does not manipulate hello ever again.
Ya give an update expression inside the loop body like this
nb::If your intention was to print the age in backwards also make sure to change line 14 to...
--hello; // update expression
cout << age << endl;
(this will correct the -ve value problem)
Last edited on