if Conditional Statement Example in C#.NET

If conditional statement is very important in any programming language. If condition is true, true block will execute other wise else block will execute.

syntax:

If(condition)
{
     true block;
}
else
{
    false block;
}

Example
if(string.IsNullOrEmpty(strCustName)
{
  console.writeline(strCustName);
}
else
{
console.writeline("customer name is empty");
}
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar