Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

user input and password

$
0
0

hello

i'm working on this code and it is'nt working properly any help on the codes

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace trial
{
    public class Password
    {
        public static void Main()
        {
            do
            {
                Console.Write("Enter a username:  ");
                string username =Console.ReadLine();

                Console.Write("Enter a password:  ");
                string pass = Console.ReadLine();

                if (username =="john"&& pass=="mjamaa")
                    Console.WriteLine("Login Error");

            }
            while (username =="john"&& pass=="mjamaa");
           
            Console.WriteLine("Login successful");
        }
    }
}
            
   


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>