Home » » The Escape Sequences in C++ - Example program 02

The Escape Sequences in C++ - Example program 02

The Escape Sequences in C++ - Example program 02
Write a program to print following output on the screen by using single cout statement.
1        2        3        4        5
6        7        8        9        10


This program can be written by using single cout statement. For this purpose we are going to be used escape sequences "\t" (it is used to insert 8 spaces) and "\n" (it is used to transfer control to the next statement).  
See program output:
Program CODE:
#include<iostream.h>
#include<conio.h>
main(){
clrscr();
cout<<"1\t2\t3\t4\t5\n6\t7\t8\t9\t10";
}
Thanks for visiting The Escape Sequences in C++ - Example program02
Download more from: CS Adventures

0 comments:

Post a Comment

LIKE US

Popular Posts

My FANS around the WORLD

Flag Counter