An if statement runs a block of code only when a condition is true. I'll show you the syntax: if (condition) { statements; } You put the condition in parentheses and the code to run in curly braces.
If the condition is false, the program skips that entire block. Here's an example: if (age >= 18) { cout << "Adult"; } prints "Adult" only when age is 18 or more. Nothing happens when age is less than 18.