c++ code to write hello world code example

Example 1: hello world c++

#include <iostream>


int main(){
 std::cout <<"Hello World" << std::endl;
 return 0;
}

Example 2: c++ code to print hello world

#include<iostream>
using namespace std;

int main(){
 
  cout << "Hello World" << endl;
  
  return 0;
}

Example 3: how to write hello world c++

#include <iostream> 

int main () 
{
  std::cout << "Hello world" << endl; 
  return 0;
}

Example 4: hello world c++

#include <iostream>
using std::cout;
int main()
{ 
    cout<<"Hello world";
    return 0;
}

Tags:

Cpp Example