Conditional structures: Difference between revisions
Content added Content deleted
(→{{header|jq}}: elif) |
m (Fix the Dao example.) |
||
Line 1,015: | Line 1,015: | ||
=={{header|Dao}}== |
=={{header|Dao}}== |
||
===If Elif Else=== |
===If Elif Else=== |
||
<lang |
<lang java>a = 3 |
||
if( a == 1 ){ |
if( a == 1 ){ |
||
io.writeln( 'a == 1' ) |
io.writeln( 'a == 1' ) |
||
} |
}else if( a== 3 ){ |
||
io.writeln( 'a == 3' ) |
io.writeln( 'a == 3' ) |
||
}else{ |
}else{ |
||
Line 1,024: | Line 1,024: | ||
}</lang> |
}</lang> |
||
===Switch Case=== |
===Switch Case=== |
||
<lang |
<lang java>a = 3 |
||
switch( a ){ |
switch( a ){ |
||
case 0: io.writeln( 'case 0' ) |
case 0: io.writeln( 'case 0' ) |
||
case 1, 2: io.writeln( 'case 1,2' ) |
case 1, 2: io.writeln( 'case 1,2' ) |
||
case 3 |
case 3, 4, 5: io.writeln( 'case 3,4,5' ) |
||
default: io.writeln( 'default' ) |
default: io.writeln( 'default' ) |
||
}</lang> |
}</lang> |
||
=={{header|Déjà Vu}}== |
=={{header|Déjà Vu}}== |
||
<lang dejavu>if a: |
<lang dejavu>if a: |