latex bold
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
The
#include <iostream>
statement includes the input/output stream library, allowing the program to perform input and output operations.The
int main()
function is the entry point of the program, where the execution begins.Within the
main()
function,std::cout
is used to print the "Hello, World!" message to the standard output.The
<<
operator is used to insert the message into the output stream.std::endl
is used to insert a new line character and flush the stream.Finally,
return 0;
is used to indicate successful termination of the program.