×

C++ Programs

C++ Most popular & Searched Programs

C++ Basic I/O Programs

C++ Constructor & Destructor Programs

C++ Manipulators Programs

C++ Inheritance Programs

C++ Operator Overloading Programs

C++ File Handling Programs

C++ Bit Manipulation Programs

C++ Classes & Object Programs

C++ program to demonstrate example of endl manipulator

Learn about the endl manipulator in C++, and demonstrate the use of endl manipulator using C++ program.
[Last updated : March 02, 2023]

endl Manipulator in C++

The 'endl' stands for end of line. Furthermore, it is used to take place to move the cursor to the beginning of the next line. Its working is similar to the '\n' escape sequence.

This program will demonstrate example of endl manipulator in c++ programming language.

endl manipulator program in C++

/*C++ program to demonstrate example of endl manipulator.*/
 
#include <iostream>
#include <iomanip>
using namespace std;
 
int main()
{
    cout << "This is line 1." << endl;
    cout << "This is line 2." << endl;
    cout << "This is line 3." << endl;
    cout << "Word1" << endl << "Word2" << endl << "Word3" << endl;
 
    return 0;
}

Output

This is line 1.
This is line 2.
This is line 3.
Word1
Word2
Word3

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.