CSharp examples for Language Basics:if
if statement usage
using System;// www . j a va 2 s .c o m public class Statements { public static void Main( ) { bool condition1 = true; bool condition2 = false; if( condition1 ) Console.WriteLine("You should see this"); if( condition2 ) Console.WriteLine("You should not see this"); if( condition1 && !condition2 ) Console.WriteLine("Will you see this?"); if( condition1 ) { Console.WriteLine("Statement 1"); Console.WriteLine("Statement 2"); } } }