Question: so with variable k state above this statement as an unsigned integer of 10. I am getting an infinite loop with this while loop as

so with variable k state above this statement as an unsigned integer of 10. I am getting an infinite loop with this while loop as pictured no matter the value of 'k" I change to it continues to be infinite. I was asked how I would fix this without changing anything inside the loop and only the line above it. I finally figured out that I must do a "do while" loop after a lot of research. My question is why was it going in an infinite loop before? In the while loop do you have to change both variables inside since they the condition? Please explain to me why this was happening, I'm I thinking about this correct?

so with variable k state above this statement as an unsigned integer

//Second Loop while (k >= i) unsigned int i{ 10 }; cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!