UMBC CMSC 201 Fall '99 CSEE | 201 | 201 S'99 | lectures | news | help

C Programming - Indentation Styles

Choose one of the two styles and use it consistently

if (condition) if (condition) { { statement(s) statement(s) } } if (condition) if (condition) { { statement(s) statement(s) } else if (condition) { } statement(s) else if (condition) } else { { statement(s) statement(s) } } else { statement(s) } for (loop control expressions) for (loop control expressions) { { statement(s) statement(s) } } while (condition) while (condition) { { statement(s) statement(s) } } do do { { statement(s) statement(s) } while (condition); } while (condition); switch (integer expression) switch (integer expression) { { case constant1: case constant1: statement(s) statement(s) case constant2: case constant2: statement(s) statement(s) default: default: statement(s) statement(s) } }


CSEE | 201 | 201 S'99 | lectures | news | help

Monday, 21-Jun-1999