- Open linux terminal/ WSL cmd
- install gcc
- $ sudo apt-get install build-essential
- Now go to that folder where you will create C++ programs
- $ sudo gedit hello.cpp
- Add the code in the file.
- Save the file and exit.
- Compile the program using any of the following command
- $ sudo g++ hello.cpp (or)
- $ sudo g++ hello.cpp -o hello
- To run this program type this command
- $ ./a.out (If you compiled using first command) (or)
- $ ./hello (If you compiled using second command)
- Output