Your First C++ Program

Here's how to write and run a simple C++ program:

#include <iostream>
using namespace std;

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

This program includes the iostream header, uses the main() function as the entry point, and prints a message using cout.

← PrevNext →