Write a Hello World C++ program in linux

Writing a hello world C++ program in linux is easy. Here are the step

  1. Create a file with cpp extension. Let’s call it program.cpp
  2. write some code in the file we created in previous step
  3. compile, build and link
  4. Run the program
#include <iostream>
using namespace std;
int main ()
{
  cout << "Hello World! ";
  cout << "I'm a C++ program";
  return 0;
}
Code language: PHP (php)

Leave a Reply

Your email address will not be published. Required fields are marked *