20. Coding Conventions

20.7. Executable Statements

 

Simple statements, such as assignment statements, should be written one per line and should be aligned with the other statements in the block. Compound statements are those that contain other statements. Examples would include if statements, for statements, while statements, and do-while statements. Com- pound statements should use braces and appropriate indentation to highlight the

 

statement’s structure. Here are some examples of how to code several kinds of compound statements:

,,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

J