πŸ’©

programierds

if-else / step by step

<code>if-else</code> conditional, no detours

Watch how the program chooses one path or the other. We use <code>edad = 16</code> so you see the <code>else</code> block execute.

1) CodeActive line: 1
1int edad = 16;
2if (edad >= 18) {
3  printf("Mayor de edad\n");
4} else {
5  printf("Menor de edad\n");
6}
7printf("Fin del ejemplo\n");
Step 1: Creates variable <code>edad</code> with value 16.
Step 1 / 7
2) Variables
edad16
Condition edad &gt;= 18-
3) Simulated console
./if-else-demostdout