C# – Conditional if … else if … else statement

As you may guess, one of the very basic form of conditional statements in C# and like many others is if … else statement.

= assigment

== equality

if (a == b){
  // execute when expression is true
 //  execute when expression is false

… or …. evaluate other mutually exclusively options;

if(a == b){
//some code
}else if(a == c){
//some code
}else if(a == d){
//some code
//catch all


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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: