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 ww  .  jav  a2s .c om*/
{
    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