Indentation - C

Indentation is alignment of statements in ‘C’ program to help improve readability. Indentation has no effect on program execution. It is for the programmer to read and understand programs easily. For example, the statement in the “if block” is written by leaving a few columns.

Now if we remove the braces of Compound statement & indent them as shows below.

‘C’ will consider if statement as containing only one printf statement. j = j * 2 followed by printf will be executed irrespective of j being greater than 100. Since we have indented all three statements, it does not mean ‘C’ will interpret them as a compound statement.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

C Topics