Guest Posted April 15, 2020 Share Posted April 15, 2020 using System; namespace ReadlinPractice { class Program { static void Main(string[] args) { string passWord = "pass123"; string userName = "user"; Console.WriteLine("Please enter your username below!"); string userName2 = Console.ReadLine(); if (userName != userName2); { Console.WriteLine("User not found! Please re-enter your username"); string userName3 = Console.ReadLine(); string result = (userName3 != userName) ? "Blocked, please try again in 5 minutes." : "Error, please restart the program."; Console.WriteLine(result); } else { Console.WriteLine("User found. Please enter your password."); string passWord2 = Console.ReadLine(); if (passWord != passWord2) { Console.WriteLine("Wrong password entered, please try again in 5 minutes"); } else { Console.WriteLine("Congrats, successfully logged in!"); } } } } } How can I fix this?? Link to comment Share on other sites More sharing options...
Ingolme Posted April 16, 2020 Share Posted April 16, 2020 The problem is the semi-colon at the end of your if() statement on line 13. Your syntax highlighter has been kind enough to underline it in green to indicate that you probably don't want it there. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now