Hello!
Today i am going to code program in C++ to print hello world, and i will also print it using different escape sequences. Hope you will like it.
Simple Program:
// Program By http://solutionscpp.blogspot.com
// Author Mansoor Ahmed
// GMail ID: secguy000@gmail.com
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello World" <<endl;
return 0;
}
Output:
Hello World
With Escape Sequences
// Program By http://solutionscpp.blogspot.com
// Author Mansoor Ahmed
// GMail ID: secguy000@gmail.com
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello\nWorld" <<endl; //it will print Hello World in seperate lines
cout<<"Hello \t World" <<endl; //it will print Hello World with a space of 1 tab
cout<<"\' Hello World \' " <<endl; //it will print Hello World in single quotes
cout<<"\" Hello World \" "<<endl; //it will print Hello World in double quotes
cout<<"\\ Hello World \\ " <<endl; //it will print Hello World in Backslash
return 0;
}
Output:
Hello
World
Hello World
' Hello World '
" Hello World "
\ Hello World \
This is nice blog. Contents over here are so informative. For more on this topic, have a look here.. Escape sequence – Object Oriented Programming (OOP)
ReplyDelete
ReplyDeletenice article for beginners.thank you.
c++ tutorial
java tutorial
I even managed to write such a program and every time hello world is the one where it starts. Recently, when I clicked on the link, I got to know a completely new release of applications that work in the cloud. I have to admit that they are used very intuitively.
ReplyDelete