#11: Switch Statement in C | C Programming for Beginners

preview_player
Показать описание
Step by step video tutorials to learn C Programming for absolute beginners!

In this video, we will learn in detail about the switch statement. We will also get an idea about the break statement. Using switch and break, we will make decision-making programs like choosing a day of a week and creating a simple calculator.

~

Watch our videos and revise them with our C App!

Timestamps:
00:00 Start
06:58 switch with multiple cases
08:16 Simple Calculator
10:12 Programming Task
10:51 Quiz

Find Programiz elsewhere:

#programiz #switchstatement #learncprogramming #learnc #coding #ctutorial #switch #case #calculator #break #switchcase #simplecalculator
Рекомендации по теме
Комментарии
Автор

🔥Finding it Damn Hard to Understand C Programming?
Learn to code—the right way—with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!

programizstudios
Автор

Programming Task:
int month;

printf("Enter numbers from 1 - 12: ");
scanf("%d", &month);

switch(month) {

case 1:
printf("January");
break;

case 2:
printf("February");
break;

case 3:
printf("March");
break;

case 4:
printf("April");
break;

case 5:
printf("May");
break;

case 6:
printf("June");
break;

case 7:
printf("July");
break;

case 8:
printf("August");
break;

case 9:
printf("September");
break;

case 10:
printf("October");
break;

case 11:
printf("November");
break;

case 12:
printf("December");
break;

}

return 0;

}

hurulaynmuhamedsalimcedarp
Автор

I wish my professor explains like you!

Lolz_amv
Автор

Im at university in the second semester nad honestly I gave up on trying to understand my programing teacher since its a very old one and it seems like she explains only for herself, this is greatly helping me to get trough the c programing material and actually have a good understanding on it. Also the answer at the end is default.

baryonyx
Автор

the code for task is:

#include <stdio.h>
int main() {
int number;
printf("enter the number between 1 to 12 :");
scanf("%d", &number);
switch (number) {
case 1:
printf("january");
break;
case 2:
printf("febuary");
break;
case 3:
printf("march");
break;
case 4:
printf("april");
break;
case 5:
printf("may");
break;
case 6:
printf("june");
break;
case 7:
printf("july");
break;
case 8:
printf("august");
break;
case 9:
printf("september");
break;
case 10:
printf("october");
break;
case 11:
printf("november");
break;
case 12:
printf("december");
break;
default :
printf("invalid number");
}
return 0;


}

benchmarkslab
Автор

Good and simple to understand. Keep doing it, we need it. I'm grateful for everyone who making this happen.

ntnmfbu
Автор

pretty good definition at the beginning . Explains where you should put what for beginners.

Remix-eu
Автор

really useful :)
please increase the frequency of these lectures

hridhanpatel
Автор

Every thing is easy if taught by this beautiful ; KEEP UP THE GOOD WORK ;

elangsankar
Автор

I love you videos, straight to the point, clear and organized

juliotitosagastegui
Автор

In the calculator code, you used default statement in the break parentheses.
as a result when you take an invalid operator input, it prints both the default part and result part.
can u fix that?

almahfuz
Автор

Nice presentation, simple and easily understandable 👍

Chief_Spartan.
Автор

Mam you exclaims very well and i can understand better than my teacher.

ludowithsanjay
Автор

From where you copied this simple calculator program its not working

everythingaboutcricket
Автор

Nyc Sister❤️ Thankyou Alot Sister Best of luck☺️💯

gamerscam
Автор

By how much time full C course will be completed??

hridhanpatel
Автор

Well Explained, u never disappoint 10/10 for me❤😊

hsirnji
Автор

Thank you so much
It has helped me a lot

tetkuel
Автор

Default will be executed, so the answer is D

racingfan
Автор

if \n is not given in scanf("%c", operator) my programm stops just before that

gowthamkarthi