Back to Curriculum

1. C++ Tutorial for Beginners

Welcome to C++!

C++ is a powerful programming language used to create software, games, and applications. It's known for its speed and efficiency.

Every C++ program starts with a main() function. This is where your program begins executing.

#include <iostream>

int main() {
    // Your code goes here
    return 0;
}

The #include <iostream> line gives us access to input and output functions like printing text to the console.

The return 0; line tells the program to end successfully.

Your First Task

Inside the main function, add a line of code to print "Hello, World!" to the console.

To do this, you'll use std::cout, which stands for "character output stream". You use the insertion operator << to send text to it.

// Example:
std::cout << "Your text here";

Add the correct line to the editor and click "Check Answer" to see your work.

🎉

Lesson Complete!

Great job! You've successfully written your first C++ program.

Continue to Lesson 2: Variables
main.cpp
Output
Click "Check Answer" to run your code.