Is there a way to use an if statement to check if an integer is equal to another integer(s)? The code below gives an error saying that the || OR operator can't be used for types int and int. Is there a better way to work around this than making each option a separate IF statement?
if (role = 7 || 11)
{
Console.WriteLine("You won!");
}
if (role = 2 || 3 || 12)
{
Console.WriteLine("You lost.");
}
Aucun commentaire:
Enregistrer un commentaire