Conditional structures: Difference between revisions
Content added Content deleted
m (Ursalang: give more of a clue about the joke in the code) |
imported>Maleza No edit summary |
||
Line 2,283: | Line 2,283: | ||
// if condition is true var will be set to 1, else false. |
// if condition is true var will be set to 1, else false. |
||
int var = condition ? 1 : 2; |
int var = condition ? 1 : 2; |
||
</syntaxhighlight> |
|||
=={{header|Curto}}== |
|||
===si-sino=== |
|||
<syntaxhighlight lang="curto">( condición ) si ( sentencias si verdadero ) entonces |
|||
( condición ) si ( sentencias si verdadero ) sino ( sentencias si falso ) entonces</syntaxhighlight> |
|||
ejemplo: |
|||
<syntaxhighlight lang="curto"> |
|||
: menor-que-diez ( n -- ) |
|||
10 < si |
|||
." Menor que 10" |
|||
sino |
|||
." Mayor o igual a 10" |
|||
entonces ; |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||