This is the small program of NOT Operator.
In this program i have used the simple login system, and it will be easy to understand by every one even he is a beginner or new for the C# programming.
In this program if the condition matches than the program give false output result.
as we can see i have putted the username - admin and password - admin123, if we insert this pair of username and password than it will give the false output because it is NOT Operator.
ENJOY CODING!!!
_________________________________________________________________________________
In this program i have used the simple login system, and it will be easy to understand by every one even he is a beginner or new for the C# programming.
In this program if the condition matches than the program give false output result.
as we can see i have putted the username - admin and password - admin123, if we insert this pair of username and password than it will give the false output because it is NOT Operator.
ENJOY CODING!!!
_________________________________________________________________________________
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Not_Operators { class PostSlush { static void Main(string[] args) { string username, password; Console.Write("Enter Username: "); username = Console.ReadLine(); Console.Write("Enter Password: "); password = Console.ReadLine(); if (!(username == "admin" && password == "admin123")) { Console.WriteLine("\nLogin Successful"); } else { Console.WriteLine("\nInvalid Username OR Password..."); } Console.ReadLine(); } } }
Tags:
csharp.net