CSharp - Write program to Use Not Equals Operator with If statement

Requirements

You will test for inequality instead of equality during the password verification.

Hint

The Not Equals Operator is !=

Demo

using System;
class Program/* ww w .j a  va 2s  . c o  m*/
{
    static void Main(string[] args)
    {
        // Correct password 
        string correctPassword = "friend";

        // Input 
        Console.Write("Enter password: ");
        string enteredPassword = Console.ReadLine();

        // Password check 
        if (enteredPassword != correctPassword)
        {
            Console.WriteLine("Incorrect password");
        }
        else
        {
            Console.WriteLine("Password is OK, please enter");
        }
    }
}

Result