C++ is an object-oriented programming language and is a much easier language than C. If you learn C++ you can easily learn all other languages that are object-oriented like JAVA, etc. It is a general-purpose multi-paradigm language.
The “Hello world” program is a simple program to display the message "Hello, World!" on the screen. This is the basic level program for introducing a new programming language. This is used to illustrate a language’s basic syntax.
Before going to the program you have to read the below points which are the basics of a C++ program working.
'//'
is considered a comment. #include
is used to include the contents of the iostream file
in our program.std::cout
is used to print any message on the screen. The content must be inside the quotation marks and followed by <<.
Example: Std::cout<< string
‘;’
is used to mark the end of a statementSTEP 1: Call the header file #include
STEP 2: Call the main function int main()
STEP 3: Call the function std::count
to print the message <<"Hello, World!"
STEP 4: Exit the program and return 0
// Simple C++ Program to print "Hello World"
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
Hello World!