CSharp examples for Language Basics:if
Use OR condition in the if...else statement
class MainClass//from w w w .j a va 2 s .com { static void Main() { char gender = 'f'; if( gender == 'm' || gender == 'f' ) { System.Console.WriteLine("The gender is valid"); } else { System.Console.WriteLine("The gender value, {0}, is not valid", gender); } System.Console.WriteLine("The if statement is now over!"); } }