The if statement executes code only if a condition is true.
cpp
if (age >= 18) { std::cout << "Adult"; }
Control Flow: If Statements
C++ Masterclass: From Zero to Hero
C++ Masterclass: From Zero to Hero
The if statement executes code only if a condition is true.
cpp
if (age >= 18) { std::cout << "Adult"; }