C++ Program to display "Hello, World!"

Problem

Write a program in C++ to display “Hello, World!” on the screen.

C++ Program to display “Hello, World!” in Console Window.

This is a simple C++ program that displays “Hello, World!” on the console window. This program provides a quick insight on to the syntax of the C++ language for the beginners.

#include <iostream>
int main() 
{
    // Program to display Hello World by Abundantcode.com
    std::cout << "Hello, World!\n";
    return 0;
}

Output

Hello, World!

The C++ programs starts with the main() function. The function cout is a standard output stream which prints the text to the display. Like the C program , the return 0 defines the exit status of the C++ program.

Tags :

Leave Your Comment

Liked this content?. Please spread the word :)