Saturday, April 26, 2025

C# - Switch Statement

using System;

namespace LearnCS
{
    class Program
    {
        static void Main(string[] args)
        {

            int lang = 500;

            switch (lang) {
                case 1:
                    Console.WriteLine("Perl");
                    break;
                case 2:
                    Console.WriteLine("Python");
                    break;
                case 3:
                    Console.WriteLine("C++");
                    break;
                case 4:
                    Console.WriteLine("PHP");
                    break;
                case 5:
                    Console.WriteLine("Java");
                    break;
                default:
                    Console.WriteLine("Unknown");
                    break;
            }

        }
    }        
}

 

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...