If_statement

If_statement in C# 
If the boolean expression evaluates to true, then the block of code inside the if statement is executed. If the boolean expression evaluates to false, then the first set of code after the end of the if statement is executed.
Example as follows.
using System; 

namespace if_Statement
  {
   class Program
 {
      static void Main(string[] args)
         {
         /* local variable definition */
         int x = 25;
         /* check the boolean condition using if statement */
         if (x < 45)
         {
            /* if condition is true then print the following statement */
            Console.WriteLine("x value is less than 45");
         }
                 Console.ReadLine();
         }
      }
}

Output- x  value is less than 45

Popular Posts