Hello World C++ Example Program in C++
On this page (7sections)
About this program
This is an example program in c basic example programs. Read the concept first: C++ Programming Structure, then study the code and output below.
Major Parts In C++ Program
- Part 1: Header File or Preprocessor Section and Namespace declaration
- Part 2: Global Variables or Global Functions // Optional
- Part 3: Class declaration // Optional
- Part 4: Main Function of C++
for better understanding,
Syntax for Simple C++ Program
// Header files
//Standard namespace declaration
// Global Variables or Functions
//Main Function
int main()
{
// Main Function Code
return 0;
}
Simple ‘Hello World’ C++ Program
/* Example Program For Hello World In C++
little drops @ thiyagaraaj.com
Coded By: THIYAGARAAJ MP */
// Header Files
#include<iostream>
#include<conio.h>
//Standard namespace declaration
using namespace std;
//Main Function
int main()
{
//Standard Ouput Statement
cout<<"Hello World";
// Wait For Output Screen
getch();
//Main Function return Statement
return 0;
}
Sample Output
Hello World
Related Pages
Learn the concept first, then study the code:
- C++ Programs — Browse all C++ Programs.
- C++ Programming Structure — Tutorial — structure of a C++ program and Hello World.
- Simple Program for Read user Input Using cin — More in c basic example programs.
- Simple Addition ( Add Two Integers ) Example Program — More in c basic example programs.