TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
324k
Switch Statement
Mar 5 2013 4:01 PM
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();
}
}
Reply
Answers (
2
)
how 2 generate Barcodes in C# ,net (windows application)?
How do I populate a combo box with a list of directories?