error: 'endl' was not declared in this scope
snippet in c

error: 'endl' was not declared in this scope

user5380

using namespace std;

Explanation:
mention "using namespace std;" above the main function in C++ will solve the 'endl' error