[updated 4.2 question] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

[updated 4.2 question]

I switched the place of the ; but it says no input or something like that, and it’s telling me to put in a } but idk where to put it. Here is my code using System; namespace MyApp { class Program { static void Main(string[] args) { //output "C# is cool" } } } static void Main(string[] args) { Console.WriteLine("C# is cool");

30th Aug 2021, 9:25 PM
A random banana
A random banana - avatar
5 Answers
+ 4
It's not possible to have 2 methods Main. And all methods must be into some class. Main method is the entry for your program, so you need to put your code there.
30th Aug 2021, 9:46 PM
Julián Fajardo
Julián Fajardo - avatar
+ 2
Read the error again
30th Aug 2021, 9:35 PM
Hima
Hima - avatar
+ 2
You write the writeline thing within the provided Main method. You don't create one outside the class.
30th Aug 2021, 10:28 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
THANK YOU TO ALL OF YOU GUYS WHO HELPED IN THE NOT UPDATED ONE AND THE UPDATED ONE! I finally finished :D
31st Aug 2021, 1:50 PM
A random banana
A random banana - avatar
0
static void Main(string[] args) { Console.WriteLine("C# is cool");
8th Sep 2021, 7:36 PM
ANGEL ALEJANDRO MONTIEL ALONSO
ANGEL ALEJANDRO MONTIEL ALONSO - avatar