+ 1
What is the errors in the following C# program.
class Program { static Main(string[] args) { int x = 10 Console.WriteLine("{0}" + x); Console.ReadLine(); }
2 Answers
+ 1
Follow benjamin's advice, and then change the WriteLine call to Console.WriteLine("{0}", x);
+ 2
I think you need a void return type on the Main signature and a semi-colon at the end of the line where you declare the int. You also need a closing curly brace on the Main method.
Also, the curly braces and quotes are not needed around the 0. If you did want to use interpolation then you'd need a dollar sign before the string, but it's not needed here.