Beginner C# Programmer
Go to solution
Solved by Supericy,
In your case, you would actually want to use "else if" statements for your code, after the initial "if" statement.
if (userValue == "1") message = "You chose 1!";else if (userValue == "2") message = "You chose 2!";else if (userValue == "3") message = "You chose 3!";else message = "You didn't chose 1, 2, or 3!";
This way, your code will only execute 1 of the if-blocks, and if none of them are true, it will execute the else-block.
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