Basic LevelFUNDAMENTALS · C++ TrackCompiler: g++ -std=c++20 -O2
C++ Basic Fundamentals & Control Flow
std::cout streams, data types, arithmetic, conditional branching, and loop iterations.
Exercises:5 Practice Labs
All C++ ModulesBasic Coding Labs (5)Click any card to start in laboratory
Lab #01 · Basic Syntax
Easy5 mins
01. Print Output with std::cout & Streams
Learn how to output text and numbers using C++ standard streams.
Objective: Write a program that prints `[*] Hello from C++20 at BytesLab!` using `std::cout` and `std::endl`.
Interactive SandboxStart Lab
Lab #02 · Variables & Types
Easy6 mins
02. Primitive Types, Casting & Arithmetic
Declare typed variables (int, double, char, bool) and perform explicit static casts.
Objective: Given integers `int total = 175` and `int count = 4`, calculate the exact floating-point average using `static_cast<double>`.
Interactive SandboxStart Lab
Lab #03 · Control Flow
Easy8 mins
03. Conditionals & If-Else Branching
Evaluate numbers and branch execution using if, else if, and else.
Objective: Write a function `std::string classifyGrade(int score)` in C++ that returns 'Pass with Distinction' for score >= 90, 'Pass' for score >= 50, and 'Fail' otherwise.
Interactive SandboxStart Lab
Lab #04 · Loops & Iteration
Easy10 mins
04. For & While Loops (Accumulators)
Calculate numerical series and iterate through loop boundaries.
Objective: Write a function `int sumMultiples(int limit)` that calculates the sum of all numbers below `limit` that are multiples of 3 or 5.
Interactive SandboxStart Lab
Lab #05 · Nested Loops
Easy10 mins
05. Nested Loops & 2D Matrix Traversals
Traverse rows and columns of 2D grids using nested loops.
Objective: Print a 3x3 multiplication table matrix formatted with row and column headers.
Interactive SandboxStart Lab