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 RUclips channel🙏🙏
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..
#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;
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; }
@@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).
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
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() ; }
printf("enter the marks "); scanf("%d",&marks); if(marks>80) value=1; else if(marks>60) value=2; else if(marks>40) value=3; switch(value) { case 1: printf("the grade is A"); break; case 2: printf("the grade is B"); break; case 3: printf("the grade is C "); break; default: printf("fail"); }
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; }
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
#include int main() {int marks; printf("enter the value of marks "); scanf("%d",&marks); switch(marks) { case 60 : case 61: case 62: case 63: case 64: case 65: case 66: case 67: case 68: case 69: printf("c grade "); break; case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: printf("b grade "); break ; case 80: case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 91: case 92: case 93: case 94: case 95: case 96: case 97: case 98: case 99: case 100: printf("a grade "); break; default : printf("d grade"); } } can do it in simple way also but this is the first way i got in mind.
#include void main() { int marks; printf("enter your marks between 0 to 100:"); scanf("%d",&marks); switch(marks/10) { case 10: printf("grade is a") ; break; case 9: printf("grade is b"); break; case 8: printf("grade is c"); break; case 7: printf("grade is d"); break; case 6: printf("grade is e"); break; default: printf("fail"); break; } }
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
int marks; printf("enter marks ="); scanf ("%d",& marks); switch (marks) { case 80: printf ("Grade A"); break; case 70 : printf ("Grade B "); break; case 60: printf ("Grade c "); break ; default: printf ("Grade D "); } printf (" work hard key to sucesss);
I love❤ this Sessions....... Thank you❤🌹 so much madam from bottom of my heart💖....... You are the only one in RUclips▶️i always waiting⏳ for ur videos madam......... Ur hardworking never wastes😇....... My education🎓 is dedicated always for you mam🙃🥰
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"); }
#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"); } }
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
#include int main() { int cg, phy, chem, math; printf("enter the marks of all the subjects, in the order phy,chem,math "); scanf("%d%d%d", &phy, &chem, &math); cg = (phy + chem + math) / 30; //for cgpa we divide the percentage by 10 and for percentage (obtained marks by 300)*100. switch (cg) { case 10: case 9: case 8: printf("first class"); break; case 7: case 6: printf("second class"); break; case 5: printf("third class"); break; default: printf("fail"); break; } printf(" congrats"); return 0; } thank you, ma'am
#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"); } }
Thank You Mam #include int main(){ int marks; printf("Enter your marks "); scanf("%d", &marks); switch(marks/10) { case 10: case 9: case 8: printf("Grade is A "); break; case 7: printf("Grade is B "); break; case 6: printf("Grade is C "); break; case 5: printf("Grade is D "); break; default: printf("Fail "); break; } return 0; }
@@Sathvika-0026 hi sathvika out of all the codes in comment section this one is absolutely correct. now lets explain your doubt. see a student is getting grade A only when his/her marks is greater than 80 ( this means if a student get 80 marks he will get grade B). . FOR all the input greater than 80 marks your logic of marks/10 will work but if we input exact 80 as input in that case also we will get 80/10= 8 and because of that student will be alloted grade A instead of B . so to avoid this we are subtracting 1 from input marks and then after dividing by 10 we will get 8 and 9 for the input greater than 80 and 7 for input greater than 70 and 6 for input greater than 60. hope it helps.feel free to ask further. btw im also learning c.
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;
float marks,frac; printf("Enter marks b/w 0-100 "); scanf("%f",&marks); int intpart=(int)marks; //integer part of marks frac=marks-intpart; //fractional part of marks intpart=(marks
Yes brother ...you wrote ...the header file studio but it is stdio and that is not mark's that is marks and you wrote the default value also wrong ... because if we write any number rather than the given one...suppose if we enter 77 so will it show ... student is fail...no ok ☺️
#include #include int main() { int marks; printf("enter the first number of your marks(suppose 89 then enter 8) you scored out of 100:"); scanf("%d",&marks); switch(marks) { case 9: printf("A garde"); break; case 8: printf("B garde"); break; case 7: printf("C grade"); break; case 6: printf("D garde"); break; default: printf("you are fail"); } return 0; }
void main() int marks; Switch(marks >) case 80 : printf(" grade is A"); break, case 70 : printf("grade is B"); break, case 60 : printf(" grade is C"); break, default printf(" Fail");
hey Jenny, am confused here, am a beginner my Lecture gave me this assignment and don't understand anything. three different questions are; Research on switch statement Shortcut method Software development cycle.
#include int main() { int Marks; printf("Please enter the marks out of 90 "); scanf("%d", &Marks); switch(Marks) { case 61: case 62: case 63: case 64: case 65: case 66: case 67: case 68: case 69: case 70: printf("Your grade is C"); break; case 71: case 72: case 33: case 74: case 75: case 76: case 77: case 78: case 79: case 80: printf("Your grade is B"); break; case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: case 90: printf("Your grade is A"); break; default: printf("Your grade is D"); } return 0; }
@@Rohit-mt5oh Firts it will print "Please enter the marks out of 90" and As scanf function is used , it will ask for the input. If the inputed number is from 61 to 70 then output will be "Your grade is C", if input is from 71 to 80 then output will be "Your grade is B", if input is from 81 to 90 then output will be "Your grade is A". But if the inputted number is not within 61 to 90 then out put will be "Your grade is D".
This the tested code. #include void main() { int marks; printf("Enter your marks: "); scanf("%d",&marks); switch(marks) { case 80 ... 100: printf("Your grade is A for marks %d",marks); break; case 70 ... 79: printf("Your grade is B for marks %d",marks); break; case 60 ... 69: printf("Your grade is C for marks %d",marks); break; case 50 ... 59: printf("Your grade is D for marks %d",marks); break; default: printf("Your grade is E for marks %d",marks); } }
#include int main() { char ch; printf("Enter the Grade:"); scanf("%c", &ch); switch (ch) { case 'A': printf("You Have marks >90"); break; case 'B': printf("You Have marks >80"); break; case 'C': printf("You Have marks >70"); break; case 'D': printf("You Have marks >60"); break; default: printf("PASSED"); } return 0; }
// Write a program in c using Nested else if lader.. #include void main() { int marks; printf("Enter marks\t"); scanf("%d",&marks); if (marks>80) printf("Grade : A "); else if (marks>70) printf("Gade : B "); else if (marks>60) printf("Grade : C "); else if (marks>50) printf("Grade : D "); else printf("F Grade "); printf("End of the program"); getch(); }
mam pls check and tell is this program right... #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; }
// Online C compiler to run C program online #include int main() { int marks; printf (" enter your marks :"); scanf("%d",&marks); marks=marks/10; switch(marks) { case 10: case 9: case 8: printf ("A grade"); break; case 7: case 6: printf("B grade"); break; case 5: printf("C grade"); case 4: printf("D grade"); default : printf ("your fail better Hard work"); } printf (" hence its result"); return 0; }
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.)
void main() { int marks; printf("Marks is greater than ?(80,70,60 or just type marks if less than 60): "); scanf("%d",&marks); switch(marks) { case 80: printf("Grade is A."); break; case 70: printf("Grade is B."); break; case 60: printf("Grade is C."); break; default: printf("Grade is D."); } }
#include int main() { int num=20; switch(num); { case 10+10 : print("number is 20"); break; } This condition is true or false if it is true give the explanation
#include int main() { int a ; printf("Enter value of a="); scanf("%d",&a); switch(a) { case 0 : printf("I am Subha"); break; case 1 : printf("Subha"); break; case 2 : printf("Subhadeep"); break ; case 3 : printf("Bose"); break; case 4 : printf("OP"); break; default : printf("None"); break; } }
Assignment program: /* Program to find grade with switch*/ #include int main() { int a; printf("Enter the Value of a: "); scanf("%d",&a); switch(a/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"); }}
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
#include int 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; case 5: printf("Grade D"); break; case 4: case 3: case 2: case1: printf("FAILED"); break; default: printf("out of switch body");
#include int main() { int grade; printf("Welcome user students "); printf ("Enter number: "); scanf("%d", &grade); switch (grade) { case 81 ... 100: printf("Your current grade is A "); break; case 71 ... 80: printf("Your current grade is B "); break; case 61 ... 70: printf("Your current grade is C "); break;
default: printf("Your grade is D "); break; } return 0; }
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
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 RUclips channel🙏🙏
#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
1st one is correct because she asked the program for the previous given program i.e. checks marks if greater than 80 and so on
#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 watch your lectures and I try the programs by myself and I really get happy when I pass. I understand your lectures so well.
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 ❤️❤️❤️❤️
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
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
We need to be very thankful to u mam ur lectures helped us a lot by gaining lots of knowledge on c language 🎉
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
Mam I am fresher and I can understand teaching of only you but not of my college Teachers so thank you so much mam 💓
How many members are skipping unacademy add
Add --ad
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
RUclips premium user
I love you, ma'am, your teaching style is wonderful.
#include
void main()
{
int marks,value;
printf("enter the marks
");
scanf("%d",&marks);
if(marks>80)
value=1;
else if(marks>60)
value=2;
else if(marks>40)
value=3;
switch(value)
{
case 1:
printf("the grade is A");
break;
case 2:
printf("the grade is B");
break;
case 3:
printf("the grade is C ");
break;
default:
printf("fail");
}
}
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;
}
Excellent teaching skills u have mam that is understanding by everyone ❤️😍😍😍
Ur explaining way Is just amazing. it helped me a lot in my studies
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
maam please keep making videos and guiding us u are my only hope because only your lectures are understandable by me
YOUR TEACHIN STYLE IS WONDERFULL MA'M
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 💖
#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;
}
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
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
#include
int main()
{int marks;
printf("enter the value of marks
");
scanf("%d",&marks);
switch(marks)
{ case 60 :
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69: printf("c grade
");
break;
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79: printf("b grade
");
break ;
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100: printf("a grade
");
break;
default : printf("d grade");
}
}
can do it in simple way also but this is the first way i got in mind.
Void main()
: char ch;
Printf("entre grade")
Scanf("%d" &char?)
Switch(ch)
Case_A:printf(greater than 80)
break;
Case_B:printf (greater than 70)
Break;
Case_C:printf(graeter than 60)
Break;
Defult printf (
this shows your coding skills brother
Can you explain the program
Hello
But madam asked to do it reverse right🤔🤔
You much get marks as input rite?
%c is used in place of%d
#include
void main()
{
int marks;
printf("enter your marks between 0 to 100:");
scanf("%d",&marks);
switch(marks/10)
{
case 10:
printf("grade is a") ;
break;
case 9:
printf("grade is b");
break;
case 8:
printf("grade is c");
break;
case 7:
printf("grade is d");
break;
case 6:
printf("grade is e");
break;
default:
printf("fail");
break;
}
}
Brilliant code
Thank you mam ..
You are a god gift to me...
For cs tq 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");
}
Mam start c++ as next course 🙏🙏🙏🙏🙏🙏🙏
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
int marks;
printf(" marks:");
scanf("%d",&marks);
switch(marks/10)
{
case 8:
printf("grade A");
break;
case 7:
printf("grade B");
break;
case 6:
printf("grade C");
break;
default:
printf("grade D");
}
amazing, Yaar 30 min se idhr udhr kr rha tha mujhe lgs solve na hoga hmse but after you, smjh aa gya.. ye grade wala .. Thanks a lot
wondering if this works, I didn't try it yet
switch (true) {
case (mark > 80):
alert("Grade A");
break;
case (mark > 70):
alert("Grade B");
break;
case (mark > 60):
alert("Grade c");
break;
default:
alert("Grade B");
}
what if I enter 98.....it will give you D
@@ruthtef4227 condition not allow in case..
@@shubhthearcher4088 case 9 bna lo ho jayega...
int marks;
printf("enter marks =");
scanf ("%d",& marks);
switch (marks)
{
case 80:
printf ("Grade A");
break;
case 70 :
printf ("Grade B ");
break;
case 60:
printf ("Grade c ");
break ;
default: printf ("Grade D ");
}
printf ("
work hard key to sucesss);
If you are our cs teacher I come even sunday to class.
Very Well Explained Lectures
Thank Uh Mam❤
I love❤ this Sessions....... Thank you❤🌹 so much madam from bottom of my heart💖....... You are the only one in RUclips▶️i always waiting⏳ for ur videos madam......... Ur hardworking never wastes😇....... My education🎓 is dedicated always for you mam🙃🥰
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
I am learning so much from my beautiful teacher! Great video Ma!
Thank u so much mam I understood clearly 🙏🙏
#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");
}
}
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
#include
int main()
{
int cg, phy, chem, math;
printf("enter the marks of all the subjects, in the order phy,chem,math
");
scanf("%d%d%d", &phy, &chem, &math);
cg = (phy + chem + math) / 30; //for cgpa we divide the percentage by 10 and for percentage (obtained marks by 300)*100.
switch (cg)
{
case 10:
case 9:
case 8:
printf("first class");
break;
case 7:
case 6:
printf("second class");
break;
case 5:
printf("third class");
break;
default:
printf("fail");
break;
}
printf("
congrats");
return 0;
}
thank you, ma'am
The teaching in the video is wonderful and mam you are looking beautiful
#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");
}
}
Mam how to print when condition is >=360-firstclass
>=250-secondclass
Other wise third class mam
Pls just give me a hint mam..
i learnt till arrays, im waiting for you to reach till there
Watched and Understood ❤
Love u so much mam 💞 ( only in subject aspect )
😂😂
😹😹😹
Thank You Mam
#include
int main(){
int marks;
printf("Enter your marks
");
scanf("%d", &marks);
switch(marks/10)
{
case 10:
case 9:
case 8:
printf("Grade is A
");
break;
case 7:
printf("Grade is B
");
break;
case 6:
printf("Grade is C
");
break;
case 5:
printf("Grade is D
");
break;
default:
printf("Fail
");
break;
}
return 0;
}
Does default have break..?🤔
@@akshaydodamani7265 not necessarily
Now I understand switch case thanks a lot mam
really such a great teacher god bless you🥰🥰
#include
#include
int main()
{
int mark;
scanf("%d",&mark);
switch((mark-1)/10)
{
case 9:
case 8:
printf("A");
break;
case 7:
printf("B");
break;
case 6:
printf("C");
break;
default:
printf("D");
}
getch();
return 0;
}
hi , why is it mark - 1 /10 and not mark /10 ??
@@Sathvika-0026 hi sathvika out of all the codes in comment section this one is absolutely correct. now lets explain your doubt.
see a student is getting grade A only when his/her marks is greater than 80 ( this means if a student get 80 marks he will get grade B). . FOR all the input greater than 80 marks your logic of marks/10 will work but if we input exact 80 as input in that case also we will get 80/10= 8 and because of that student will be alloted grade A instead of B . so to avoid this we are subtracting 1 from input marks and then after dividing by 10 we will get 8 and 9 for the input greater than 80 and 7 for input greater than 70 and 6 for input greater than 60.
hope it helps.feel free to ask further. btw im also learning c.
Thank you very much ma'am for making this video. It helped me lot in my exam.❤❤
Tq, u r giving complete crystal clear information.. 🙏
U re really an extraordinary teacher ....🥰😍
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();
}
Your teaching is so good
Thank you so much mam...I understood it very clearly...🙏👍👍😇
float marks,frac;
printf("Enter marks b/w 0-100 ");
scanf("%f",&marks);
int intpart=(int)marks; //integer part of marks
frac=marks-intpart; //fractional part of marks
intpart=(marks
can even use case 5 ... 0: rather than writing all
awesome lecture mam thank you
#include
#include
Void main()
{
Int marks;
Printf ("enter th Mark's");
Scand("%d",& Marks);
Switch(marks)
{
Case '90':
Printf (" A grade");
break;
Case '80':
Printf(" B grade");
break;
Case ' 70':
Printf ("C grade");
Break;
Case '60':
Printf(" D grade");
Break;
Case '50' :
Printf(" just passed");
Break;
Default:
Printf (" the student fail" );
}
Getch();
}
This is wrong
Where it is wrong
Can u explain
What if I enter 87?
Will it show fail?
Yes brother ...you wrote ...the header file studio but it is stdio and that is not mark's that is marks and you wrote the default value also wrong ... because if we write any number rather than the given one...suppose if we enter 77 so will it show ... student is fail...no ok ☺️
@@beknowledgeable5558
Yes bro
Ur right
#include
#include
int main()
{
int marks;
printf("enter the first number of your marks(suppose 89 then enter 8) you scored out of 100:");
scanf("%d",&marks);
switch(marks)
{
case 9:
printf("A garde");
break;
case 8:
printf("B garde");
break;
case 7:
printf("C grade");
break;
case 6:
printf("D garde");
break;
default:
printf("you are fail");
}
return 0;
}
void main()
int marks;
Switch(marks >)
case 80 :
printf(" grade is A");
break,
case 70 :
printf("grade is B");
break,
case 60 :
printf(" grade is C");
break,
default
printf(" Fail");
hey Jenny, am confused here, am a beginner my Lecture gave me this assignment and don't understand anything. three different questions are; Research on switch statement
Shortcut method
Software development cycle.
#include
int main()
{
int Marks;
printf("Please enter the marks out of 90
");
scanf("%d", &Marks);
switch(Marks)
{
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69:
case 70:
printf("Your grade is C");
break;
case 71:
case 72:
case 33:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
printf("Your grade is B");
break;
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
printf("Your grade is A");
break;
default:
printf("Your grade is D");
}
return 0;
}
Plz what would be the output
@@Rohit-mt5oh Firts it will print "Please enter the marks out of 90"
and As scanf function is used , it will ask for the input. If the inputed number is from 61 to 70 then output will be "Your grade is C", if input is from 71 to 80 then output will be "Your grade is B", if input is from 81 to 90 then output will be "Your grade is A". But if the inputted number is not within 61 to 90 then out put will be "Your grade is D".
This the tested code.
#include
void main()
{
int marks;
printf("Enter your marks: ");
scanf("%d",&marks);
switch(marks)
{
case 80 ... 100:
printf("Your grade is A for marks %d",marks);
break;
case 70 ... 79:
printf("Your grade is B for marks %d",marks);
break;
case 60 ... 69:
printf("Your grade is C for marks %d",marks);
break;
case 50 ... 59:
printf("Your grade is D for marks %d",marks);
break;
default:
printf("Your grade is E for marks %d",marks);
}
}
#include
int main()
{
char ch;
printf("Enter the Grade:");
scanf("%c", &ch);
switch (ch)
{
case 'A':
printf("You Have marks >90");
break;
case 'B':
printf("You Have marks >80");
break;
case 'C':
printf("You Have marks >70");
break;
case 'D':
printf("You Have marks >60");
break;
default:
printf("PASSED");
}
return 0;
}
Good one
You're an amazing teacher ma'am.your method of teaching helps to understand the topic very well.stay blessed always 🙏😊
😇Why i am smiling unconditionally when you smile 😊
thank you very much mam you're smart c++ next please
Mam ek dam accha se samaj aa gya switch in c
What to do if i want to run program like I/P -> Monday ..... Friday O/P -> Working day & I/P -> Saturday, sunday. O/P -> Holiday . PLEASE HELP ❤️
Perfect Explaination
I like your way of teaching maam thank u for spreading knowledge.
jenny you are very much great
Love you Jenny😍😍😍
A thankful video 🥰😘
number of case must in single quotation
such as
case '1' .......
case '2' .......
in that exampl.
// Write a program in c using Nested else if lader..
#include
void main()
{
int marks;
printf("Enter marks\t");
scanf("%d",&marks);
if (marks>80)
printf("Grade : A
");
else if (marks>70)
printf("Gade : B
");
else if (marks>60)
printf("Grade : C
");
else if (marks>50)
printf("Grade : D
");
else
printf("F Grade
");
printf("End of the program");
getch();
}
mam pls check and tell is this program right...
#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;
}
the teachings are awesome,,, but improve the font size or use another type of ink,, I can't see the programs clearly 😕
Sure
Will u please make a video on C++ programming also
// Online C compiler to run C program online
#include
int main() {
int marks;
printf (" enter your marks :");
scanf("%d",&marks);
marks=marks/10;
switch(marks)
{
case 10:
case 9:
case 8:
printf ("A grade");
break;
case 7:
case 6:
printf("B grade");
break;
case 5:
printf("C grade");
case 4:
printf("D grade");
default :
printf ("your fail better Hard work");
}
printf ("
hence its result");
return 0;
}
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.)
Your teaching method is very nice mam so many video posted to the python java and c++ programs thank you mam🙏👌👌🥰
Mam instead of writing the code on the board please show the execution then we will get clear idea about the topic
Mam in switch case why float values are not taking
void main()
{
int marks;
printf("Marks is greater than ?(80,70,60 or just type marks if less than 60): ");
scanf("%d",&marks);
switch(marks)
{
case 80:
printf("Grade is A.");
break;
case 70:
printf("Grade is B.");
break;
case 60:
printf("Grade is C.");
break;
default:
printf("Grade is D.");
}
}
#include
int main()
{
int num=20;
switch(num);
{
case 10+10 : print("number is 20");
break;
}
This condition is true or false if it is true give the explanation
Good question
true hai
Wrong a } is left to close
False!?!
@Our culture
16:14
We should only use integer values or character cinstants
#include
int main() {
int a ;
printf("Enter value of a=");
scanf("%d",&a);
switch(a)
{
case 0 : printf("I am Subha");
break;
case 1 : printf("Subha");
break;
case 2 : printf("Subhadeep");
break ;
case 3 : printf("Bose");
break;
case 4 : printf("OP");
break;
default : printf("None");
break;
}
}
Assignment program:
/* Program to find grade with switch*/
#include
int main()
{ int a;
printf("Enter the Value of a: ");
scanf("%d",&a);
switch(a/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");
}}
Good explanation of Switch statement
Thank you so much❤ mam🤗
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
3:33 integral type evaluation of switch statement
#include
int main(){
int mark;
printf("Enter your mark: ");
scanf("%i",&mark);
switch(mark){
case 1: if(mark>=80){
printf("A+");}
break;
case 2: if(mark>69){
printf("A");}
break;
case 3: if(mark>59){
printf("A-");}
break;
default : printf("So bad");
}
printf("
Try your best");
}
#include
int 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;
case 5:
printf("Grade D");
break;
case 4:
case 3:
case 2:
case1:
printf("FAILED");
break;
default:
printf("out of switch body");
}
return 0;
}
#include
int main()
{
int grade;
printf("Welcome user students
");
printf ("Enter number: ");
scanf("%d", &grade);
switch (grade)
{
case 81 ... 100:
printf("Your current grade is A
");
break;
case 71 ... 80:
printf("Your current grade is B
");
break;
case 61 ... 70:
printf("Your current grade is C
");
break;
default:
printf("Your grade is D
");
break;
}
return 0;
}
Mam only single charactor use in this statement?
String charactor is not allowed?