This Switch Statement is not compiling. Please tell what is the wrong with it?
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Rating(1-10): ");
int n = int.Parse(Console.ReadLine());
switch (n)
{
case1:case2:case3:
Console.WriteLine("Poor");
break;
case4:case5:case6:
Console.WriteLine("Average");
break;
case7:case8:
Console.WriteLine("Good");
break;
case9:case10:
Console.WriteLine("Excellent");
break;
default:
Console.WriteLine("Invalid Grade");
break;
}
Console.ReadKey();
}
}
Switch Statement
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Mar 5, 2013, 11:24 AM EST
The following compiles and runs fine:
Posted Mar 5, 2013, 11:51 AM EST