Every C++ program starts with #include directives that bring in standard library features, then a main() function — the entry point the OS calls when your program runs.
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
#include <iostream> — pulls in input/output streamsusing namespace std; — lets you write cout instead of std::coutcout << — sends text to the terminalendl — ends the line and flushes the bufferreturn 0; — signals success to the OSYou can chain multiple values:
cout << "Sum: " << 3 + 4 << endl;
// Output: Sum: 7
Print exactly: Hello, C++!
Click "Run" to execute your code.