Register now or log in to join your professional community.
static void Main(string[] args)
{
int a =5, b =;
if (Convert.ToBoolean(Convert.ToInt(++a)) || Convert.ToBoolean(Convert.ToInt(++b)))
{
Console.WriteLine(a + "\\n" + b);
}
else
Console.WriteLine(" C# ");
}
Appear error says: Invalid expression term from b=;
"b" needs to init value.
Thank you so much for invitation for answer.
Anas
There are three major problem with code.
1. "Invalid term expression": meaning the variable 'b' need to be initialized (given a value).
2. "Convert.ToInt" is not recognized in C# and it should be "Convert.ToInt"
3. "\\n" is not correct to get a new line and it should have only one backslash