Oh, it's 'cause you're trying to assign an integer with the return value of a Console.WriteLine(...) call, which happens to be void.
That little ?: thing is a replacement for if/else.
- (boolean test) ? (true statements) : (false statements)
... is exactly equivalent to ...
- if (boolean test)
-
(true statements)
-
else
-
(false statements)
So what your statements come out to be is this...
- int n = 1;
-
int m;
-
if (n < 10)
-
m = Console.WriteLine("1");
-
else
-
m = Console.WriteLine("2");
-
-
...
In all cases, you'll need to ditch the Console.WriteLine if you want to assign a value to m. If you want m to be an integer, then just have..
If you want the Console.WriteLine part, skip assignment and write the full if/else statement.
Hope that helps.