0% found this document useful (0 votes)
14 views

C Reference Manual - October 2005.92

This document provides a summary of C language statements in 3 sentences or less: The document lists common C language statements including conditional if/else statements, looping while and do-while statements, switch statements, jump statements like goto, return, break and continue, and expression statements. Examples are given for if/else, while, do-while, for, switch, return, goto, break, continue, and expression statements. Notes indicate that items in brackets are optional and statements can have zero or more case labels or a default case.

Uploaded by

diegoifg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

C Reference Manual - October 2005.92

This document provides a summary of C language statements in 3 sentences or less: The document lists common C language statements including conditional if/else statements, looping while and do-while statements, switch statements, jump statements like goto, return, break and continue, and expression statements. Examples are given for if/else, while, do-while, for, switch, return, goto, break, continue, and expression statements. Notes indicate that items in brackets are optional and statements can have zero or more case labels or a default case.

Uploaded by

diegoifg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

C Compiler Reference Manual

STATEMENTS
STATEMENT
if (expr) stmt; [else stmt;]

while (expr) stmt;


do stmt while (expr);

for (expr1;expr2;expr3) stmt;


switch (expr) {
case cexpr: stmt; //one or
more case [default:stmt]
... }

return [expr];
goto label;
label: stmt;
break;
continue;
expr;
;
{[stmt]}

EXAMPLE
if (x==25)
x=1;
else
x=x+1;
while (get_rtcc()!=0)
putc(n);
do {
putc(c=getc());
} while (c!=0);
for (i=1;i<=10;++i)
printf(%u\r\n,i);
switch (cmd) {
case 0: printf(cmd 0);
break;
case 1: printf(cmd 1);
break;
default:printf(bad cmd);
break; }
return (5);
goto loop;
loop: I++;
break;
continue;
i=1;
;
{a=1;
b=1;}

zero or more
Note: Items in [ ] are optional

80

You might also like