Check out example codes for "error: 'endl' was not declared in this scope". It will help you in understanding the concepts better.

Code Example 1

using namespace std;

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

Learn ReactJs, React Native from akashmittal.com