Back Button
Back to Chapter
C++ Introduction
No items found.
C++ Basics
No items found.
C++ Control Statements
No items found.
C++ Logical Operators
No items found.
C++ Procedural Programming
No items found.
C++ Structural Programming
No items found.
C++ Implementation of OOPS
No items found.
C++ Arrays and Vectors
No items found.
C++ Error Handling
No items found.
C++ File Handling
No items found.
Collapse_Icon
Table of Contents

To see how C++ works, copy-paste the code given below and run the program. If you need instructions on how to save and execute scroll down.

#include using namespace std; main() { cout<<"Hello World"; //cout basically tells the compiler to display //what's in the "" on the screen }
Output: Hello World

First save your file:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d1d4e01f-0034-492a-9c82-a6494a887d02/Untitled_3.png

click on save as.

Choose the location where you wish to save your file and click save.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3d0ae9e9-9546-49c9-97c6-a59f5ec037b6/Untitled_5.png

Once it is saved, we need to run and check the program.

Execute>>Compile and run

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c953310d-6010-4d53-adc0-2417eaa7f1ec/Untitled_4.png

After a few seconds the output should be visible on .exe file.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/888a9ae5-f2ac-4e40-be93-b9c5e7c26aef/Untitled_6.png

If your code has any errors the compiler will detect them and they will be displayed in the error window.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e3431cd8-8301-41d1-86ee-ade42b206141/errors.png

Spot the error in the  given code.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5d59c4a8-98cf-4c71-816c-48a7d74fd0fd/errorwindow.png

C++ will spot the error during compilation and highlight the error while also displaying a message on how to correct the error.