Answer to Question #334449 in C# for Adarsh

Question #334449

create a console application to test usage of switch case construct. Accept some integer from user as command line argument and using a switch case construct

1
Expert's answer
2022-04-27T18:25:12-0400
class Program
{
    static void Main()
    {
        int number = int.Parse(Console.ReadLine());
        switch (number)
        {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
                Console.WriteLine("Your number is between 1 - 10");
                break;
            default:
                Console.WriteLine("Your number is not between 1 - 10");
                break;
        }


    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS