An ordered set of instructions. It reads input, follows rules, and produces output.
Loading...
Loading...
Workspace
performance systems algorithms and contests
Definition first
C++ is a programming language for writing exact instructions, often used for performance systems algorithms and contests. Start with one mental model: input goes through steps and becomes output.
main.cppRun g++ main.cpp -std=c++17 && ./a.outHabit Trace memory values indexes and container state before compilingAn ordered set of instructions. It reads input, follows rules, and produces output.
A value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
C++17 compiler is the place that actually runs code from main.cpp.
First readable code
#include <iostream>
using namespace std;
int main() {
cout << 42;
}Output 42Language lineage
See where C++ comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
C++ question 1. Choose the statement that matches output stream.
C++ question 2. Choose the statement that matches integer type.
C++ question 3. Choose the statement that matches vector push.
C++ question 4. Choose the statement that matches reference.
C++ question 5. Choose the statement that matches output stream.
C++ question 6. Choose the statement that matches integer type.
C++ question 7. Choose the statement that matches vector push.
C++ question 8. Choose the statement that matches reference.
C++ question 9. Choose the statement that matches output stream.
C++ question 10. Choose the statement that matches integer type.
C++ question 11. Choose the statement that matches vector push.
C++ question 12. Choose the statement that matches reference.
C++ question 13. Choose the statement that matches output stream.
C++ question 14. Choose the statement that matches integer type.
C++ question 15. Choose the statement that matches vector push.
C++ question 16. Choose the statement that matches reference.
C++ question 17. Choose the statement that matches output stream.
C++ question 18. Choose the statement that matches integer type.
Multiple choice
C++ question 1. Choose the statement that matches output stream.
cout << 42;
Reference
g++ main.cpp -std=c++17 && ./a.outcin cout headers namespace
#include <iostream>
using namespace std;
int main() {
cout << 42;
}int double bool string vector
int score = 40 + 2; cout << score;
vector map set queue stack
vector<int> v = {1, 2, 3};
cout << v.size();