Hello World In C++ Programming


The program is a simple C++ program that prints the message "Hello World...!" to the console. Let's break down the program line by line:

  • #include: This line is a preprocessor directive that includes the iostream library, which provides the cout object used to output data to the console.
  • using namespace std;: This line declares that we want to use the std namespace. The std namespace is used by the C++ Standard Library, which includes functions and objects that are commonly used in C++ programs.
  • int main(): This is the main function of the program. Every C++ program must have a main() function, which is the starting point of the program.
  • {: The opening curly brace marks the beginning of the main function.
  • cout<<"Hello World...!";: This line uses the cout object from the iostream library to output the message "Hello World...!" to the console.
  • return 0;: This line returns an integer value of 0 to the operating system, indicating that the program has executed successfully.
  • }: The closing curly brace marks the end of the main function.

Source Code

#include<iostream>
using namespace std;
 
int main()
{
    cout<<"Hello World...!";
    return 0;
}
 

Output

Hello World...!
To download raw file Click Here

Program List


Flow Control

IF Statement Examples


Switch Case


Goto Statement


Break and Continue


While Loop


Do While Loop


For Loop


Friend Function in C++


String Examples


Array Examples


Structure Examples


Structure & Pointer Examples


Structure & Functions Examples


Enumeration Examples


Template Examples


Functions


Inheritance Examples

Hierarchical Inheritance


Hybrid Inheritance


Multilevel Inheritance


Multiple Inheritance


Single Level Inheritance


Class and Objects

Constructor Example


Destructor Example


Operator Overloading Example


Operator and Function Example


List of Programs


Pointer Examples


Memory Management Examples


Pointers and Arrays


Virtual Function Examples