Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Switches in C are easy! ๐Ÿ’ก
Play lesson

C tutorial for beginners โš™๏ธ - Switches in C are easy! ๐Ÿ’ก

4.0 (0)
13 learners

What you'll learn

This course includes

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

Summary

Keywords

Full Transcript

#coding #programming #cprogramming // switch = An alternative to using many if-else statements // More efficient w/ fixed integer values char dayOfWeek = '\0'; printf("Enter a day of the week (M, T, W, R, F, S, U): "); scanf("%c", &dayOfWeek); switch(dayOfWeek){ case 'M': printf("It is Monday"); break; case 'T': printf("It is Tuesday"); break; case 'W': printf("It is Wednesday"); break; case 'R': printf("It is Thursday"); break; case 'F': printf("It is Friday"); break; case 'S': printf("It is Saturday"); break; case 'U': printf("It is Sunday"); break; default: printf("Please only enter a character (M, T, W, R, F, S, U)"); } return 0;

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