Friday, January 31, 2014

user input and password


Change your code to:



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

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

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

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





Regards, http://ift.tt/1e8mnao





Your code doesn't seem to work. Please update it with the correct code. Thanks!


Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)



Answer an interesting question? Create a wiki article about it!


No comments:

Post a Comment