Check two conditions and or them together - CSharp Language Basics

CSharp examples for Language Basics:if

Description

Check two conditions and or them together

Demo Code

using System;//from  w  w w .j  a v  a2  s  . c  om
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
   static void Main(string[] args)
   {
      // Input
      Console.Write("Do you love me? ");
      string input = Console.ReadLine();
      // Evaluating
      string inputInSmall = input.ToLower();
      if (inputInSmall == "yes" || inputInSmall == "no")
      {
         Console.WriteLine("OK.");
      }
      else
      {
         Console.WriteLine("Say it straight!");
      }
   }
}

Result


Related Tutorials