Use if statement to check int value - CSharp Language Basics

CSharp examples for Language Basics:if

Description

Use if statement to check int value

Demo Code

class iftest//from  w w w . jav  a  2s. c o  m
{
   static void Main()
   {
      int Val1 = 1;
      int Val2 = 0;
      System.Console.WriteLine("Getting ready to do the if...");
      if (Val1 != Val2)
      {
         System.Console.WriteLine("If condition was true");
      }
      System.Console.WriteLine("Done with the if statement");
   }
}

Result


Related Tutorials