tubeshowcase●1,661,199 videos♡ My collection 0
← Learn to Code

Learn to Code08:08

Switches in C are easy! 💡

Bro Code ↗

From the creator

#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;

Published 2025-03-06 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code