C++ Bug Hunt Easy +10 XP
Missing endl
Output doesn't appear immediately in some terminals.
C++Find the bug
1
cout << "Processing..."; The bug is on line 1
Select the correct fix
Show answer and explanation
Answer: Both A and C flush the buffer
cout is buffered. endl flushes and adds newline. \n adds newline but '\n' alone doesn't flush. endl guarantees immediate output.
Hint: Buffered output may not appear until flushed.
What this challenge tests
Bug Hunt in C++: cout, buffering.