0

How can I convert this code to csharp code, seems to be simple but little confused.

Dim Temperature As Integer = 30   

   Select Case Temperature
                Case 31
                    Console.WriteLine("stay in bed")
                Case 32
                    Console.WriteLine("play the lottery")
                Case Else
                    Console.WriteLine("Just read the newspaper")
    End Select
1
Contributor
3
Replies
4
Views
4 Years
Discussion Span
Last Post by sanjeewa.abeywardana
0

how silly of me to write like this

     int Temperature= 30;

                switch (Temperature)
                {
                    case 31:
                        Console.WriteLine("stay in bed");
                        break;
                    case 32:
                        Console.WriteLine("play the lottery");
                        break;
                    defualt:
                        Console.WriteLine("Just read the newspaper");
                }

    Console.Read();
see, what's wrong? , just for fun find it :-) , LOL...
0

ok , it's the default in line 11 , it is wrong

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.