How to print text in C++?
There is a simple way of printing text in C++. You can use the 'cout' object along with the insertion operator, '>>'. You need to write all the basic lines of C++ code first and inside a curly bracket'{}', write 'cout>>' and then write the text in double quotes (""). Also remember to add the semi-colon at the end of the line.
For example-
#includeusing namespace std; int main() { cout Try It Out HereAdding a break between two pieces of text
You can add a break between lines by adding '\n' after every piece of text that has to be printed. For example-
#includeusing namespace std; int main() { cout Try It Out HereSimilarly, the number of lines can be increased by adding '\n' characters at the end of the lines.
Adding a horizontal tag
You can add a horizontal tag by writing '\t' at the end of the line like the '\n'. For example;
#includeusing namespace std; int main() { cout Try It Out HerePutting double quotes around a piece of text
You can put double quotes by adding '\"' at the start and the end of the piece of text. For example-
#includeusing namespace std; int main() { cout Try It Out HereThat is all for this post. Follow this blog to get more info on coding.
Regards,
Aarav IyerReferences;
(1) https://www.w3schools.com/cpp/cpp_output.asp