Hello World! program in C++

By | February 18, 2024

Problem statement :
Start from the famous 'Hello World' code. This program prints 'Hello World' when executed.

Explanation :
The 'Hello World' is a common or simple example to check compiler and library presence. It has minimum chances of user error (during compilation), because it has only one file to compile.

This simple program uses the C++ standard library, with std::cout from <iostream>.

Code :

#include <iostream>

// Driver
int main()
{
    // Your first program
    std::cout << "Hello World!" << std::endl;
}

Output :
The output of the program should be −

Hello World! 

Author: Mithlesh Upadhyay

I hold an M.Tech degree in Artificial Intelligence (2023) from Delhi Technological University (DTU) and possess over 4 years of experience. I worked at GeeksforGeeks, leading teams and managing content, including GATE CS, Test Series, Placements, C, and C++. I've also contributed technical content to companies like MarsDev, Tutorialspoint, StudyTonight, TutorialCup, and Guru99. My skill set includes coding, Data Structures and Algorithms (DSA), and Object-Oriented Programming (OOPs). I'm proficient in C++, Python, JavaScript, HTML, CSS, Bootstrap, React.js, Node.js, MongoDB, Django, and Data Science.