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?
//Second Loop while (k >= i) unsigned int i{ 10 }; coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started