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
Step-by-Step Guide
-
Step 1: Open or create a C++ file.
Feel free to name it anything you want.
Save it somewhere you can remember. -
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. -
Step 3: In the next line
-
Step 4: type using namespace std; which translates to "use the standard library."
-
Step 5: On the next line
-
Step 6: type int main(){.
-
Step 7: On the next line
-
Step 8: type cout << .
-
Step 9: Continue the line with the text you want to display on the screen inside quotation marks("s).
-
Step 10: End the line with a semi-colon(;).
-
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
Patricia Armstrong
Enthusiastic about teaching pet care techniques through clear, step-by-step guides.
Rate This Guide
How helpful was this guide? Click to rate: