Pages

Thursday, June 22, 2017

Hello World in C++

Let’s begin with a simple C++ program to display "Hello World" on the screen.

Example: Hello World Program in C++

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

Output of program

Hello World

Description of Program
  • C++ program starts from the main() function.
  • cout is the standard output stream to print "Hello, World!" on monitor.
  • return 0; indicates program ends and returns 0 to calling program.
* * * * *


No comments:

Post a Comment