Quote:
I have this piece of code that I am trying to exit when the user inputs a number for K, how to i terminate the loop with that number?
Since the user do not input anything for
K
, I fear we can't help you on this.
You need to refine the question with details on what you try to do.
For what I see, the
for
loop can completely be removed.