C# error. Please help me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# error. Please help me.

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Variable_Example { class Program { static void Main(string[] args) { int i = 1; switch (i) { case 1: Console.WriteLine(One"); break; case 2 Console.WriteLine("Two"); Console.WriteLine("Two"); default: Console.WriteLine("Other"); break; } } } }

11th Jul 2020, 8:16 AM
Apola Rahman
Apola Rahman - avatar
1 Answer
+ 4
2 mistakes 1) you forgot to put starting inverted comma (") in Console.WriteLine("one") 2) forgot to put colon after case 2 [FIXED] https://code.sololearn.com/cd7BLTQdU61B/?ref=app
11th Jul 2020, 8:20 AM
Raj Chhatrala
Raj Chhatrala - avatar