How to Display Text on the Screen in C+

Open or create a C++ file., Write at the top the command #include ., In the next line, type using namespace std; which translates to "use the standard library.", On the next line, type int main(){., On the next line, type cout

11 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Open or create a C++ file.

    Feel free to name it anything you want.

    Save it somewhere you can remember.
  2. Step 2: Write at the top the command #include <iostream>.

    This translates into "use the pre-made file named iostream".

    You may not have of created it, but it comes with many C++ downloads.

    This provides you with the command vital for displaying text. , , This is the main function, the main set of commands, that the program looks for.

    All lines after this are usually indented. , This is the command used to display text.

    Make sure you indent it. ,, Then, on the next line, type "}".

    Don't indent it. , It should be near the top of the screen and should look like a gear and a green arrow.

    A pop-up should appear displaying the text in quotations.
  3. Step 3: In the next line

  4. Step 4: type using namespace std; which translates to "use the standard library."

  5. Step 5: On the next line

  6. Step 6: type int main(){.

  7. Step 7: On the next line

  8. Step 8: type cout << .

  9. Step 9: Continue the line with the text you want to display on the screen inside quotation marks("s).

  10. Step 10: End the line with a semi-colon(;).

  11. Step 11: Locate the "build and run" button.

Detailed Guide

Feel free to name it anything you want.

Save it somewhere you can remember.

This translates into "use the pre-made file named iostream".

You may not have of created it, but it comes with many C++ downloads.

This provides you with the command vital for displaying text. , , This is the main function, the main set of commands, that the program looks for.

All lines after this are usually indented. , This is the command used to display text.

Make sure you indent it. ,, Then, on the next line, type "}".

Don't indent it. , It should be near the top of the screen and should look like a gear and a green arrow.

A pop-up should appear displaying the text in quotations.

About the Author

P

Patricia Armstrong

Enthusiastic about teaching pet care techniques through clear, step-by-step guides.

99 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: