C++ Tutorial

C++ If...Else

Conditional Statements

Use conditions to run different code paths based on logical tests.

int n = 8;
if (n > 5) std::cout << "big";
Try it Yourself
Run this CPP example in your local environment or course sandbox.