I'm new to C# I'm using microsoft Visual Studio Express 2013 Windows Desktop edition and I was trying to make a quiz in which I ask the question and the user has to answer it so, here's the code and the error i get is "Cannot implicitly convert type 'string' to 'bool'" and this happens on the 2 if statements, I understand that a bool has either the value true or false however it's a string so why is it giving me this error? Any help should be appreciated. PS: I only included the part of the code in which i'm having the problem and this is the only code in the main class
Heres the code:
Start:
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Question 1: Test? type yes or no: ");
String answer1 = Console.ReadLine();
if (answer1 = "yes") {
Console.WriteLine();
Console.WriteLine("Question 2: Test? type Yes or no");
}
else if (answer1 = "no")
{
Console.WriteLine();
Console.WriteLine("Wrong, restarting program");
goto Start;
}
else {
Console.WriteLine();
Console.WriteLine("Error");
goto Start;
}