How To Print Hello World in C++

Everyone starts at some point to learn something new. However, this concept is valid and invalid for programmers,  learning new languages. As every time learn a new programming language, the ritual of writing the first Hello World program remains the same. So it’s always a great thing to start learning any new programming language with a hello world program. Therefore today we’ll start the journey of C++ programming. By learning how to print Hello World in C++.

One of the easiest and simple programs, you’ll ever write in C++. The reason is that whatever program you’ll write next is going to be a level up than this one.

 

What’s The Approach?

 

  • Firstly, include an input output header file.

 

  • Next, create a main function/method.

 

  • Finally, we’ll write a print statement by passing a string, Hello World.

 

Also Read: How to Install MinGW C/C++ Compiler in Windows 11

 

C++ Program To Print Hello World

 

Output:

Hello World

 

// Simple C++ program to
// Print "Hello World"

// Header file for
// input output stream
#include <iostream>

using namespace std;

// main function -
int main()
{
    // prints hello world
    cout << "Hello World";

    return 0;
}

Ethix

I'm a coding geek interested in cyberspace who loves to write and read

Leave a Reply

Your email address will not be published.