Hello, World in C++
The classic first C++ program. Press Run to try it, then change the code and run it again.
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
Output
Press Run to see the output.
More C++ examples
- Vectors and sort · Read numbers into a vector, sort them and find the largest.
- Classes and objects · A class with a constructor, private data and member functions.
- Count words with a map · Use std::map to count how often each word appears.
- Binary search · Find a value in a sorted array in O(log n) steps.
- Competitive programming template · Fast input and output with bits/stdc++.h, ready for contest problems.