vendredi 18 décembre 2020

Problem with same output of if and else statements

I have started programming a week week ago, and was stuck in an if else related problem. The code i wrote was :-

Console.WriteLine("hello, what is your username?");
  string name = Console.ReadLine();
    Console.WriteLine("hi, " + name + " nice to meet you!");
    
    Console.WriteLine("please enter your password");
   string password = Console.ReadLine();
   if (password == "blablabla")
   {
    Console.WriteLine("you are signed in");
   }
   else;{
    Console.WriteLine("incorrect password");}

And, at the output, even if i put the right password, it shows "you are signed in" as well as "incorrect password". Please tell me what am I doing wrong, thanks :)

Aucun commentaire:

Enregistrer un commentaire