👶 Your First C++ Program – Hello, World!
Let’s write your very first C++ program. This is where your coding journey truly begins! 🚀
📄 The Code
Here’s a simple C++ program that says hello to the world. Classic stuff — but super important!
#include <iostream> // includes input/output stream library using namespace std; // allows you to use standard features without std:: prefix int main() { cout << "Hello, C++ World!" << endl; // prints text to the screen return 0; // signals that the program ended successfully }
🖨️ Output
Hello, C++ World!
🧠 Let’s Understand the Code
#include <iostream>
– Gives access to input/output functions likecout
.using namespace std;
– Lets you writecout
instead ofstd::cout
.int main()
– This is where your program starts running.cout << "..."
– Prints text to the console.return 0;
– Ends the program successfully.
💡 Fun Fact
Every C++ program starts with main()
. It’s like the front door where the magic begins! 🪄