Conditional expressions

In conditional expressions, we may write ‘=’ instead of ‘==’, but compiler won’t complain. We can use compiler to catch such errors by following this tip “Reverse right hand side of the expression with left hand side of the expression” Examples: 1. a = 0 is not error but 0 = a is error 2. a = b + c is not error but b + c = a is error Only case where this tip won’t work is a = b

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s