Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:46:11+00:00 2026-06-05T20:46:11+00:00

I have no idea why I’m getting this following error: Control cannot fall through

  • 0

I have no idea why I’m getting this following error:

Control cannot fall through from one case label (‘case “h”:’) to another (CS0163)

Only for H and S – quite strange.

switch(myChoice)
{
    case "K":
    case "k":
        Console.WriteLine("You have chosen the Kanto region");
        break;
    case "O":
    case "o":
        Console.WriteLine("You have chosen the Orange Islands");
        break;
    case "J":
    case "j":
        Console.WriteLine("You have chosen the Johto region");
        break;
    case "H":
    case "h":
        Console.WriteLine("You have chosen the Hoenn region");
    case "S":
    case "s":
        Console.WriteLine("You have chosen the Sinoh region");
    case "U":
    case "u":
        Console.WriteLine("You have chosen the Unova region");
        break;
    case "R":
    case "r":
        Console.WriteLine("Return");
        break;
    default:
        Console.WriteLine("{0} is not a valid choice", myChoice);
        break;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:46:12+00:00Added an answer on June 5, 2026 at 8:46 pm

    Fallthrough only works when the case statement has no body. Since your “h” and “s” cases have code present, you need a break after them.

    Additionally, as a suggestion: you could do a String.ToUpper() on your switch parameter so you can avoid having to check for both the lowercase and uppercase variants of myChoice. Your switch statement then becomes:

    switch(myChoice.ToUpper())
    {
        case "K":
            Console.WriteLine("You have chosen the Kanto region");
            break;
        case "O":
            ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Can Any one have idea about below code and its related error. code:
I don't have idea about overlay.I am stuck at this point.I am integration one
I have idea to write errors from my application to the Windows Event Viewer
Anyone have idea how to pass value from iPhone application to the REST-Webservice using
I have no idea if this is possible, but if it is, what would
I have idea to implement my wpf windows like TabPages in tab control. It
can any body have idea for create dynamic class at run time.i have one
Does any one have idea how to do it in blackberry. -------------------------------------- tab 1
can any one have idea how to implement custom paging in silverlight / telerik
Remove last digit from B_NBR. These all numbers are different. anybody have idea about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.