If Conditions

Sometimes we want our program to take decisions by reading external inputs. Without decisions, our program acts in same way for any input.

To make decisions we use if, else if, else control structures.

You can use following coding formats:

untitled

Following program reads an input from user & prints some details according to the value of that input.

untitled

 

Advertisements
If Conditions

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