The Escape Sequences in C++ - Example program
Write a C++ program to print "I Love Pakistan" on screen using single cout statement with the help of escape sequences.
output must loot like as under:
I
LOVE
PAKISTAN
See below, it is solution of above program
In this program escape sequence "\n" is used. It is used t transfer the printing control to the next statement.
CODE:
#include<iostream.h>
#include<conio.h>
main(){
clrscr();
cout<<"I\nLOVE\nPAKISTAN";
}
#include<conio.h>
main(){
clrscr();
cout<<"I\nLOVE\nPAKISTAN";
}
0 comments:
Post a Comment