Question 5
Back to Exercise
The program below does not compile. Which statement correctly describes the problem?
#include <iostream>
using std::cout;
int main() {
cout << "Done" << endl;
return 0;
}
- A cout must also be qualified
- B Only cout was brought in with using; endl is still std::endl and is undeclared on its own Correct
- C endl requires <iomanip>
- D Strings need single quotes
Correct Answer: Option B
A using-declaration imports exactly one name. Add using std::endl;, write std::endl, or simply use '\n'.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!