Anonymous user
Conditional structures/C: Difference between revisions
m
→if-then-else: consistent indent; removed {{works with}}
m (often) |
m (→if-then-else: consistent indent; removed {{works with}}) |
||
Line 2:
===if-then-else===
<lang c>int main (int argc, char ** argv) {
int input = 2;
if (
/* Do something */
}
if (
/* Do something */
} else {
Line 21 ⟶ 20:
One line predicates do not require curly braces (although their usage is often preferred for readability):
<lang c>if (cond)
else
And these may be mixed:
<lang c>if (cond)
else
{
Line 37:
}</lang>
<lang c>if (cond)
{
/* multiple expressions */
|