Type this program exactly as shown:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
Click run. You should see "Hello, World!" in the output panel. This program has six lines. Each line serves a specific purpose.
If you delete any line except the blank one, the program stops working. Over the next units, I will explain what each line does. Congratulations.
You just wrote and executed your first C++ program. Every C++ program you write will have this same basic structure. Now let us break down each part.