Please read the new rule regarding the restriction on the use of AI tools. ×

Zenith_053's blog

By Zenith_053, history, 14 months ago, In English

Why Idleness limit is occurring even though I have used cout.flush(); Help would be really appreciated Question Link My Solution

  • Vote: I like it
  • +8
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it +5 Vote: I do not like it

You have to use cout.flush() in while loop too, before using cin.

»
14 months ago, # |
  Vote: I like it +5 Vote: I do not like it
»
14 months ago, # |
  Vote: I like it +5 Vote: I do not like it

<3 THNX But can you tell me why is that?

  • »
    »
    14 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it
    1. You didn't flush
    2. You were printing wrong number before for and it was waiting for more numbers.