if-else Statement in C — a practical guide to C if else with clear examples you can reuse in real projects.
C Programming Tutorial Series (29/102). Prefer one article? Read the complete C programming tutorial.
Short description
Always brace multi-line bodies; be careful with dangling else.
if-else
if (n % 2 == 0) {
printf("evenn");
} else {
printf("oddn");
}