using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“AAAAAAAAAAA?”);
string AAA = Console.ReadLine();
if (AAA == “AAAAAAA!”);
{
Console.WriteLine(“AAAAA”);
}
else
{
Console.WriteLine(“AAAAAAA”);
}
}
}
}
Semicolon after the if
oh well… I’m truly an idiot.
thank you!
What are the errors?
CS8641 else cannot start a statement.
CS1003 syntax error ‘(‘ expected.
CS1525 invalid expression term ‘else’
CS1026 ) expected.
CS 1525 invalid expression term ‘else’.
CS1002 ; expected.
AAAAAAAAAA! Also, try removing the ; at the end of the if-line.
Remove the semicolon after if -clause
if (AAA == “AAAAAAA!”); <–
Lines starting with four spaces are treated like code.
Besides that, there is a semi-colon after the if statement if(AAA == “AAAAAAA!”);
C# devs
null reference exceptions