In this Program example, you will learn to print Hello World.
In this program, you’ll learn to print Hello World using input and output functions.
The Hello World program is one of the simplest programs, but it already contains the fundamental components that every C++ program has. Don’t be overwhelmed, we will take a look at the code line by line.
Program to print Hello World!
#include <iostream> using namespace std; int main() { cout << "Hello, World!"; return 0; }
Output
Hello, World!
Note: Every C++ program starts from the main()
function.
The cout
is the standard output stream which prints the “Hello, World!” string on the monitor.
The return 0; is the Exit status” of the program.
Program to Print Hello World! using std function
#include <iostream> int main() { std::cout << "Hello, World!"; return 0; }
Output
Hello, World!
Related Program
- C++ Program to Print Number Entered by User
- C++ Program to Add Two Numbers
- C++ Program to Find Quotient and Remainder
- C++ Program to Find Size of int, float, double and char in Your System
- C++ Program to Swap Two Numbers
- C++ Program to Find ASCII Value of a Character
- C++ Program to Multiply two Numbers
Ask your questions and clarify your/others doubts on how to print statement by commenting. Documentation.
Please write to us at [email protected] to report any issue with the above content or for feedback.