Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# switches ๐Ÿ”€
Play lesson

C# tutorial for beginners ๐ŸŽต - C# switches ๐Ÿ”€

5.0 (6)
48 learners

What you'll learn

This course includes

  • 4 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

C# switch tutorial example explained #C# #switch #tutorial using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // switch = an efficient alternative to many else if statements Console.WriteLine("What day is it today?"); String day = Console.ReadLine(); switch (day) { case "Monday": Console.WriteLine("It's Monday!"); break; case "Tuesday": Console.WriteLine("It's Tuesday!"); break; case "Wednesday": Console.WriteLine("It's Wednesday!"); break; case "Thursday": Console.WriteLine("It's Thursday!"); break; case "Friday": Console.WriteLine("It's Friday!"); break; case "Saturday": Console.WriteLine("It's Saturday!"); break; case "Sunday": Console.WriteLine("It's Sunday!"); break; default: Console.WriteLine(day + " is not a day!"); break; } Console.ReadKey(); } } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere