Objective:
Write a C++ program that prints “Hello, World!” to the console.
Task:
- Write a simple C++ program that outputs “Hello, World!”.
- Use the
coutcommand to display the message.
Code:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}Explanation:
- This is a basic C++ program that uses the
coutstatement to print “Hello, World!” to the console. - The
endlcommand moves the output to the next line.
Expected Output:
Hello, World!