Table of contents
1.
Introduction
2.
FAQs:
3.
Key Takeaways: 
Last Updated: Mar 27, 2024
Easy

“Hello, World!” Program

Author NISHANT RANA
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

A “Hello, World!” program prints the “Hello, World!” in the output screen. Mostly every new programmer does this program for an introduction to Coding.


Following is the C++ “Hello, World!” program:

// Your First C++ Program


#include <iostream>


int main() {
    std::cout << "Hello, World!";
    return 0;
}

Output: 

Hello, World!
 

 

You practice by yourself with the help of online c++ compiler.
Let us see each statement individually:

  1. // Your First C++ Program: The lines which start with “//” are comments. These are the lines which are ignored by the C++ compiler.
     
  2. #include <iostream>: It is a preprocessor directive used to include files in our program. In our current program, we are including the contents of <iostream> file. 
     
  3. std::cout << "Hello, World!";: This statement is used to print the String inside the quotation marks(“ “). In our current program, we are printing Hello, World!.
     
  4. return 0;: It is the Exit status of the program. The program terminates after this statement.

FAQs:

  1. What is a “Hello, World!” program?
    A “Hello, World!” program prints the “Hello, World!” in the output screen. Mostly every new programmer does this program for an introduction to Coding.
     
  2. What is std::cout?
    This statement is used to print the String inside the quotation marks(“ “). In our current program, we are printing Hello, World!.

Key Takeaways: 

In this article, we have extensively discussed the following things:

  1. We first discussed what is a “Hello, World!” program.
  2. Then we discussed the program.

We hope that this blog has helped you enhance your knowledge regarding the “Hello, World!” program and if you would like to learn more, check out our articles here.

Also read -  Decimal to Binary c++

Do upvote our blog to help other ninjas grow. Happy Coding!







 

Live masterclass