Skip to content
UPEEC

if-else

Chooses between two paths.

Beginner
Comments 0
if (adc > threshold) led_on(); else led_off();

Always use braces — it prevents the "dangling else" and goto-fail style bugs.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.