CSharp - Write program to check if user input is one of the allowed alternatives

Requirements

You will write a program that checks whether the user entered either yes or no.

All other inputs will be considered incorrect.

Hint

To disregard the difference in case, you convert the input to lowercase letters.

The condition used is a compound condition.

It consists of two partial conditions connected using the conditional OR operator, ||

Demo

using System;
class Program/*  w w  w .ja  va 2s .  c o  m*/
{
    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("wrong input!");
        }
    }
}

Result