New Line Escape Sequence Program Example using CPP

  1. Home
  2. Tutorials
  3. CPP
  4. CPP Programs
  5. Escape Sequence
  6. Program

Source Code

#include <iostream>

using namespace std;

int main(int argc, char** argv) {
 

      // Output without Escape Sequence
    cout<<" First Second Third Forth Fifth";   

      // Output with Escape Sequence
    cout<<" First \n Second \n Third \n Forth \n Fifth";
   

return 0;
}

Output

new line escape sequence code example in c++

Working

This program demonstrate usage of new line escape sequence. There are two output statements that are used to show impact of \n (new line escape sequence) on output.

 

 

Comments
Login to TRACK of Comments.