CMSC 313 Spring 2011
Announcements
|
Exams
|
FAQ
|
Home
|
Projects
|
Resources
|
Schedule / Notes
|
Staff
|
Syllabus
CMSC 313 - C Indentation Standards
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) } }
Top of Page
Last Modified: Tuesday, 28-Dec-2010 15:42:49 EST