Hello Currently I'm reading a book on c++ algorithms and I stumbled upon the Fibonacci numbers and how to iterate through them
but I don't get 1 thing and that is it has a while loop which is really confusing.
because in it n decremented by 1 with no conditions.
my question is how does the loop stop and why isn't the loop an endless one I mean after 0 it should go to 4294967295 -1 and on on why doesn't this happen?
The condition of a while or even a do/while loop boils down to either being true or false, i.e., true a number greater than zero or false zero.
So as long as "n" is greater than zero the condition is true. And when "n" becomes zero the while condition will fail and the while loop is passed over to the next line of coed.