CLab
Interactive C playgroundLOOPS & CONDITIONS
CODE. STEP. UNDERSTAND.

See your code in motion.

Follow every condition, branch, and iteration.

if / else
Step 0 / 4
Source codeC
condition.c editable
Ready to visualize
Try age = 15 to follow the else branch. Edit the code above, then press Play.
Supported C syntax

One int declaration followed by if, optional else if branches, and an optional else. Compare the variable with an integer using <, <=, >, >=, ==, or !=. Braced bodies support printf text and one %d with the variable. Nested conditions, logical operators, and full programs are not supported.

Execution flowREADY
01 · DECLAREint age = 20;
IFage >= 18pending
true →
BRANCH BODY
printf("Adult\n");
↓ false · check next branch
ELSEOtherwisepending
then →
BRANCH BODY
printf("Minor\n");
Continue after the conditional

Ready to execute

Step through the declaration, test the condition, and follow the selected branch.

VARIABLE WATCHLine —
ageint
—Not initialized
THE BRANCH RULE

Check in order.
Run the first match.
Skip the rest.

Console outputstdout 0 lines
Output will appear here when printf executes▌