Conditional structures: Difference between revisions
Content added Content deleted
(added MDL) |
m (→{{header|I}}) |
||
Line 2,191: | Line 2,191: | ||
=={{header|I}}== |
=={{header|I}}== |
||
<lang i>//'i' supports if, else, and else if |
|||
software { |
|||
a = 3 |
|||
//This is not guaranteed to be quicker than a if-else chain. |
|||
if a = 3 |
|||
⚫ | |||
case 3 |
|||
⚫ | |||
print("a = two") |
|||
case 2 |
|||
print("WHAT?") |
|||
default |
|||
print("3!=2") |
|||
} |
|||
⚫ | |||
⚫ | |||
print("verified") |
|||
else |
else |
||
print(" |
print("a = ", a) |
||
end |
end |
||
}</lang> |
}</lang> |