C
C#2y ago
Aelia

✅ What is wrong with my main method?

It says "The local function 'Main' is declared but never used" Am I not using it already? I want to call the other methods in my Main method.
14 Replies
TheBoxyBear
TheBoxyBear2y ago
All methods declared after Tal_2_lika_olika are actually inside that method and not the class
Aelia
AeliaOP2y ago
oh ty xd
TheBoxyBear
TheBoxyBear2y ago
also
Console.WriteLine("The table is ");
Console.WriteLine(num1 + " x 1 = " + (num1 * 1));
Console.WriteLine(num1 + " x 2 = " + (num1 * 2));
Console.WriteLine(num1 + " x 3 = " + (num1 * 3));
Console.WriteLine(num1 + " x 4 = " + (num1 * 4));
Console.WriteLine(num1 + " x 5 = " + (num1 * 5));
Console.WriteLine(num1 + " x 6 = " + (num1 * 6));
Console.WriteLine(num1 + " x 7 = " + (num1 * 7));
Console.WriteLine(num1 + " x 8 = " + (num1 * 8));
Console.WriteLine(num1 + " x 9 = " + (num1 * 9));
Console.WriteLine(num1 + " x 10 = " + (num1 * 10));
Console.WriteLine("The table is ");
Console.WriteLine(num1 + " x 1 = " + (num1 * 1));
Console.WriteLine(num1 + " x 2 = " + (num1 * 2));
Console.WriteLine(num1 + " x 3 = " + (num1 * 3));
Console.WriteLine(num1 + " x 4 = " + (num1 * 4));
Console.WriteLine(num1 + " x 5 = " + (num1 * 5));
Console.WriteLine(num1 + " x 6 = " + (num1 * 6));
Console.WriteLine(num1 + " x 7 = " + (num1 * 7));
Console.WriteLine(num1 + " x 8 = " + (num1 * 8));
Console.WriteLine(num1 + " x 9 = " + (num1 * 9));
Console.WriteLine(num1 + " x 10 = " + (num1 * 10));
Might want to use a loop for that 🙂
Aelia
AeliaOP2y ago
thank u :D im learning C# in school so i have already made all the other methods in other projects xd its still not working :/
Aelia
AeliaOP2y ago
Aelia
AeliaOP2y ago
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point
TheBoxyBear
TheBoxyBear2y ago
Still declared under Tal_2_lika_olika becasue of a missing closing bracket
Aelia
AeliaOP2y ago
how do u notice i reread the program like 3 times xd
TheBoxyBear
TheBoxyBear2y ago
In VS Code, the static keywords were a different color starting after Tal_2_lika_olika so I figured something was up
Aelia
AeliaOP2y ago
i use vs community the purple one should i use the blue one
TheBoxyBear
TheBoxyBear2y ago
To avoid errors like this, you can check bracket pairs by putting the cursor on one to see the matching one, running Code Cleanup in VS to "fix" indentation. I also use the Viasfora extension to color pairs differently. Also embrase the auto closing of brackets. When you open, it automatically adds the closing one and puts your cursor in between.
TheBoxyBear
TheBoxyBear2y ago
Also when you see alignes brackets like that that's usually a sign something's up somewhere
Aelia
AeliaOP2y ago
oki, thank u so much!!
Accord
Accord2y ago
Closed!
Want results from more Discord servers?
Add your server