C_31 Switch Statement In C | C Programming Tutorials
Vložit
- čas přidán 11. 01. 2021
- In this video, I have discussed the Switch Case in C with a flowchart and program.
Best C Programming Tutorials : • Programming in C
*******************************************
Connect & Contact Me:
My Second Channel Link: bit.ly/354n7C7
Facebook: / jennys-lectures-csit-n...
Quora: www.quora.com/profile/Jayanti...
Instagram: / jayantikhatrilamba
Twitter: / khatrijenny
*********************************************
More Playlists:
C++ Programming Tutorials: • Lec 1: How to Install ...
Placement Series: • Placements Series
Data Structures and Algorithms: https: • Data Structures and Al...
Design and Analysis of Algorithms(DAA): • Design and Analysis of...
Python Full Course: • Python - Basic to Advance
Printing Pattern in C: • Printing Pattern Progr...
Dynamic Programming: • Dynamic Programming
Operating Systems: // • Operating Systems
DBMS: • DBMS (Database Managem...
#cprogramming #jennyslectures #programming #clanguage #switchcase
#include
main()
{
int marks;
printf("Enter marks ");
scanf("%d",&marks);
switch (marks/10)
{
case 10:
case 9:
case 8:
printf("Grade A");
break;
case 7:
printf("Grade B");
break;
case 6:
printf("Grade C");
break;
default: printf("Grade D");
}
}
That's wrong program, when you try to enter the marks. 9 the output is coming great d.
here is the correct program;---
#include
int main()
{
int a;
printf("Enter a value:");
scanf("%d",&a);
switch (a)
{
case 10:
case 9:
case 8:
printf("Grade A");
break;
case 7:
printf("Grade B");
break;
case 6:
printf("Grade C");
break;
default: printf("Grade D");
}
return 0;
}
mam pls check and tell... tq..
Both are correct
1 st code marks for 100 i.e;user would have to enter marks for 100
2nd code marks for 10
i.e; user would have to enter marks for 10
This ma'am is the best. She does so much for us. Love to her and her family and the little one.
Little one means ???
Kid h mam k??
lol little one , as if you are the father
How many members are skipping unacademy add
youtube pro usesers
Add --ad
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
i know it's very difficult to make videos daily along with family and explain topics in detail
thank you mam for making these videos
i mean all of them that u made
🙏🙏🙏🙏 🙇🙇🙇🙇
i didn't go to a good college
but i found a teacher like you now i can learn all the concepts from your CZcams channel🙏🙏
Once this is finished can help us to create a live project using c++/c language it will help us for better understanding 🙏🏻
One of the best series of programming in C language ❤️❤️❤️❤️
Mam you have been helping me too much with your videos.
The way you explain is very easy to understand i have only to say thank and ask you please don't stop making video such that, you may not know but your videos are very useful for us.
by the way i am from Mozambique
Excellent teaching skills u have mam that is understanding by everyone ❤️😍😍😍
I love❤ this Sessions....... Thank you❤🌹 so much madam from bottom of my heart💖....... You are the only one in CZcams▶️i always waiting⏳ for ur videos madam......... Ur hardworking never wastes😇....... My education🎓 is dedicated always for you mam🙃🥰
maam please keep making videos and guiding us u are my only hope because only your lectures are understandable by me
Tq, u r giving complete crystal clear information.. 🙏
Thank you so much mam...I understood it very clearly...🙏👍👍😇
Ur explaining way Is just amazing. it helped me a lot in my studies
Thank you mam ..
You are a god gift to me...
For cs tq mam
Really your all lecture are superb nd it helps more nd more to learn any concept in depth 👍👍so we thanks to you for making free content like this ❤️
But only one think is you miss that iss captions
#include
int main()
{
int marks;
printf("Enter the marks out of 100 ");
scanf("%d",&marks);
switch(marks/10)
{
case 10:
case 9:
case 8:
printf("your grade is A");
break;
case 7:
printf("Your grade is B");
break;
case 6:
printf("Your grade is c");
break;
default: printf("your grade is d");
}
return 0;
}
marks/100 should be their in the place of expression
@@Shreyas_K1044 then it will show only default ...
Bro in case of 80 marks it have to print 'B' grade but according to your program it is printing 'A' grade
@@leelasaikrish1966 IT DOESNT MATTER ,,, LOGIC MATTERS ,,,, AND LOGIC IS TRUE...@attila6013
👍👍 true and logical
it works
I love you, ma'am, your teaching style is wonderful.
Ma'am please finish this course as fast as possible I have a exam in next month
Same mam..... Please complete ....
code with harry sa kar la bro
I watch your lectures and I try the programs by myself and I really get happy when I pass. I understand your lectures so well.
I am learning so much from my beautiful teacher! Great video Ma!
Mam start c++ as next course 🙏🙏🙏🙏🙏🙏🙏
We need to be very thankful to u mam ur lectures helped us a lot by gaining lots of knowledge on c language 🎉
U re really an extraordinary teacher ....🥰😍
Thanks a lot for your help 🔥👍
Mam I am fresher and I can understand teaching of only you but not of my college Teachers so thank you so much mam 💓
wow, i really love this particular session Thanks for the impact ma, you even explained much better than my lecturer, this will really help me in my forthcoming exam
23:40
#include
#include
int main()
{
int marks;
printf("Enter your marks: ");
scanf("%d", &marks);
switch(marks){
case 80 ... 100:
printf("Grade A
", marks);
break;
case 70 ... 79:
printf("Grade B
", marks);
break;
case 60 ... 69:
printf("Grade C
", marks);
break;
case 35 ... 59:
printf("Grade D
", marks);
break;
default:
printf("You are failed
");
}
printf("Statement X
");
return 0;
}
super vroo 👏👏👏
👍
Why did you used the 3 dots in between 70 and 79 ?
@@bhukyabhanuprasad The "..." is called the range operator in C and is used to specify a continuous range of values. In this particular case, "case 80 ... 100" indicates that the code block following it will be executed if the expression being evaluated falls within the range from 80 to 100 (inclusive).
@@devSackey thanks isaac
YOUR TEACHIN STYLE IS WONDERFULL MA'M
Perfect Explaination
Thank you very much ma'am for making this video. It helped me lot in my exam.❤❤
really such a great teacher god bless you🥰🥰
If you are our cs teacher I come even sunday to class.
A thankful video 🥰😘
All the solutions of Let Us C book exercise are explained here::
czcams.com/play/PLa86zDUJh7Hd-dpKArE1L9UWBEGKkRTdb.html
Thank you so much mam 🔥🔥🔥
Thank u so much mam I understood clearly 🙏🙏
Now I understand switch case thanks a lot mam
Thanks a lot ma'm ap ny c start kar di
Really bundles of thanks.
Ap ny dda start ki thi to mujhy lga c language skip kar di ap ny ab nhi parhaen gi
Again Thanks
Good explanation of Switch statement
Love you Jenny😍😍😍
22:09
code ↓
#include
int main(){
int marks;
printf("please enter your marks
");
scanf("%d",&marks);
switch(marks/10){
case 10:
case 9:
case 8: printf("you have got a A grade");
break;
case 7:printf("you have got a B grade");
break;
case 6:printf("you have got a C grade");
break;
default:printf("you have got a D grade");
}
return 0;
}
Thank you so much❤ mam🤗
jenny you are very much great
Your teaching is so good
After this c programming, kindly post videos on python programming also mam. As I understand clearly if you teach❤️❤️
Have you cleared the 'c' language?
Hii you are damn cute 💖
You are really superb mam
So nice explanation.
Watched and Understood ❤
I like your way of teaching maam thank u for spreading knowledge.
int main()
{
int marks;
coutmarks;
switch (marks)
{
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
cout
Thankyou mam ❤️
The teaching in the video is wonderful and mam you are looking beautiful
Awesome mam
Mam ek dam accha se samaj aa gya switch in c
Love u so much mam 💞 ( only in subject aspect )
😂😂
😹😹😹
Thanks ❤️mam
Thank you
super video mam
thank you mam
#include
Int main()
{
Int marks;
Print("enter the marks");
Scanf("%d",&marks);
Switch(marks)
{
Case(80to100):
Printf("a grade");
Break;
Case(70to80):
Printf("b grade");
break;
Case(50to70):
Printf("c grade");
Break;
Case(below 40):
Printf("d grade");
Break;
Case:
Printf("not grade");
Break;
}
return 0;
}
Here is my program. It satisfies all the cases.
int marks;
printf("enter marks:");
scanf("%d",&marks);
if (marks % 10 == 0) // If marks multiple of 10, then remove 1 from the marks. If you need to print the marks, use another variable to keep track of the real marks.
marks = marks - 1;
switch (marks/10)
{
case 10:
case 9:
case 8:
printf("grade A");
break;
case 7:
printf("grade B");
break;
case 6:
printf("grade C");
break;
default:
printf("grade D");
}
Great thinking
Thankyou mam
23:40
void main()
{
int marks ;
printf("Enter marksbetween 0 to 100 : ") ;
scanf("%d" , &marks) ;
switch(marks/10)
{
case 10 :
case 9 :
case 8 :
printf("
Your grade is A") ;
break ;
case 7 :
printf("
Your grade is B") ;
break ;
case 6 :
printf("
Your grade is C") ;
break ;
default :
printf("
Your grade is D") ;
}
getch() ;
}
Why getch()
@@gvincent3246 to hold the screen
Yeh Badiya Tha Guru....!
@@praveenkumarp7150 it won't show error because he had given int not float so it will print only integer not decimal values
No
Keep it up
you are amazing maam
thank you very much mam you're smart c++ next please
Thnx mam
Thnku ma'am literally thnx!!
Mam in the program two it's just about vowel and consonant but if we enter any special character it will print as a consonant so how should we include in the switch statement...please explain mam
You're an amazing teacher ma'am.your method of teaching helps to understand the topic very well.stay blessed always 🙏😊
super teacher
#include
void main()
{
int marks;
printf("Enter your marks");
scanf("%d",&marks);
switch(marks)
{
case 90:
case 80:
case 70:
printf("A grade");
break;
case 60:
case 50:
printf("B grade");
break;
case 40:
printf("C grade");
break;
default:printf("D grade");
break;
printf("All the best");
}
}
Is including default case is mandatory ?
i learnt till arrays, im waiting for you to reach till there
#include
int main()
{
int mark;
printf("Enter values");
scanf("%d",&mark);
switch(mark/10)
{
case 10:
case 9:
case 8:
printf("A");
break;
case 7:
printf("B");
break;
case 6:printf("C");
break;
default:printf("D");
}
}
tq mam
Mam how to print when condition is >=360-firstclass
>=250-secondclass
Other wise third class mam
Pls just give me a hint mam..
❤️❤️
int marks;
printf("Enter the marks : ");
scanf("%d", &marks);
char ch = marks > 80 ? 'A' : marks > 70 ? 'B' : marks > 60 ? 'C' : 'D';
switch (ch)
{
case 'A':
printf("Grade A");
break;
case 'B':
printf("Grade B");
break;
case 'C':
printf("Grade C");
break;
default :
printf("Grade D");
}
Waiting for more videos specially array
What if we take case 1 and then again case 1 and putting two different statement in both cases, will both the cases run at input value 1 ?
In first case 1 if you don't write break;
Then it will check and execute next case i.e. next case 1.
Until and unless the control finds the break keyword, it will execute all the cases.
The moment control finds the break keyword, it will come out of the switch block statements and statement x would be executed(which is not part of the switch block statements but the part of the program.)
Will u please make a video on C++ programming also
Mam can we use for loop for case values
Your teaching method is very nice mam so many video posted to the python java and c++ programs thank you mam🙏👌👌🥰
😇Why i am smiling unconditionally when you smile 😊
Mam only single charactor use in this statement?
String charactor is not allowed?
3:33 integral type evaluation of switch statement
madam since we can only check equality , how can we do that task using switch?
I love you ma'am
❤️
thank you so much mam🤩
Please mam, when u start tuple calculus in DBMS,,,,,, please reply mam,,,🙏🙏🙏🙏
madam excelent ur lectures and u r also so beautiful....tq madam.
Ma'am please make video on recurrence relation in DAA
Mam in switch case why float values are not taking
ma'am why will the other cases be executed if the value that we're getting from the expression isn't the same as that of the case value?
Firstly, the case which matches with the value we have entered will be executed. And if we doesn't specify break after the case, then all other cases would also be executed till it finds break keyword.
Mam please give notes for entire c programming pdf please mam💚🙏
Can we write more than one statement under any case like case1: and within this multiple statements.
Yes
I just increase the workload
i did it in the most inefficient way😢
but anyway this is how i did it
#include
#include
void main()
{
int marks,ch;
printf("Enter your marks:");
scanf("%d",&marks);
if (marks>=80)
ch=1;
else if (marks>=60)
ch=2;
else if (marks>=50)
ch=3;
else if (marks>=30)
ch=4;
switch (ch)
{
case 1 : if (marks>=80)
printf("Grade S");
break;
case 2 : if (marks>=60)
printf("Grade A");
break;
case 3 : if (marks>=50)
printf("Grade B");
break;
case 4 : if (marks>=30)
printf("Grade C");
break;
default: printf("Grade D");
break;
}
getch();
}
number of case must in single quotation
such as
case '1' .......
case '2' .......
in that exampl.