Switch Case Control Statements In C: C Tutorial In Hindi #11
HTML-код
- Опубликовано: 27 апр 2019
- In this c programming tutorial video, I have explained you about if else conditionals in c and examples of the same in c. I hope you are enjoying this C course in Hindi.
►This C Lecture is a part of this C Programming Course: • C Language Tutorials I...
►Source Code + Notes: codewithharry.com/videos/c-la...
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Learn Python In Hindi ...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithharry.com
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
Hope sab samajh me aa raha hai!
Is this course going slow or fast????? Please please reply me??? I am getting mixed feedback. Thanks a lot!
Perfect
..
Notes kb se aayegi
its going normal
Sir array aur pointer thoda aur brief description De dijiye Jisey bade program bhi try kr sake
Very nice explanation sir? Mere saare doubts clear ho gaye. Thank you sir!
#include
int main()
{
int day_no;
printf("enter day_no
");
scanf("%d",&day_no);
switch (day_no)
{
case 1:
printf("monday
");
break;
case 2:
printf("tuesday
");
break;
case 3:
printf("wednesday
");
break;
case 4:
printf("thrusday
");
break;
case 5:
printf("friday
");
break;
case 6:
printf("saturday
");
break;
case 7:
printf("sunday
");
break;
default :
printf("input must be between 1-7
");
}
return 0;
}
Bro give me your number please
Great
bahut cute hey
😊
Mujhe toh kuch samjh nhi aara😢😢😢😢
Kon kon 2024 me dekh raha hai❤❤
Me also!
Maaah
Me
Mee
me
Code using Switch for Speed of vehicle
#include
int main()
{
int speed;
printf("Enter your speed
");
scanf("%d", &speed);
switch (speed)
{
case 40:
printf("Your speed is 40");
break;
case 50:
printf("Your speed is 50");
break;
case 60:
printf("Your speed is 60");
break;
default:
printf("Your speed is not 40, 50 or 60");
}
return 0;
}
❤
Galat h bhai
{
int score;
printf("Enter your score
");
scanf("%d",&score);
switch(score)
{
case 12:
printf("your score is 12");
break;
case 16:
printf("your score is 16");
break;
default:
printf("your score is not 12 or 16");
}
return 0;
}
Bhai C padhi hai but use refresh krni thi but aap padha rhe ho toh shuru se padhne me jyada maja aa raha hai
Thank you keep it up.
Welcome bro!
Harry bhai aapke teaching ka tareeka ek dum unique and elementary hai. Aap koi bhi concepts samjhate ho to bohot achche se aur ideal proof ke saath teach karate ho usko easily breakdown karke. Thank you so much.
As a beginner I was unable to understand .But your vidoes are seriously soo good, very easy to understand ❤ Also thankyou for your vlogs.
Hello brother,
You r doing a great job.
As per your question ,The course is going fast but then to getting it understand by repeating the video
My Switch program
#include
int main()
{
int marks;
printf("enter your marks
");
scanf("%d", &marks);
switch (marks)
{
case 10:
printf("your marks is 10
");
break;
case 20:
printf("your marks is 20
");
break;
default:
printf("your mark is not 10,20");
}
return 0;
}
Best course on C I found on youtube after long research. You teach in a very intuitive way with appropriate practical examples and exercises and quizzes.
#include
int main()
{
int temp;
printf("Enter the temperature in degree Celsius");
scanf("%d",&temp);
switch(temp)
{
case 40:
printf("Hot
");
break;
case 10:
printf("Cold
");
default:
printf("Invalid input");
}
return 0;
}
Hey Harry I'm literally watching your videos and actually it's easy to learn and I can easily implement in programs.
// Challenge accepted
/*
author:Nikhil Raj
purpose:To learn Switch Cases
date:18/06/2019
*/
#include
int main(){
int kitnepanipuris;
scanf("%d",&kitnepanipuris);
switch (kitnepanipuris)
{
case 0:
printf("Bhaiya 10 ke
");
break;
case 2:
printf("Thode aur khilao
");
break;
case 4:
printf("Thik hae bhia kitna hua
");
break;
default:
printf("Ache Pani puri hae");
break;
}
return 0;
}
😂😂🙏🏻🙏🏻🙏🏻
osm bruh🤣🤣🤣🤣
wonderful bro
lmao it's not valid......
bhai tune starting me printf me kuch likha hi nhi
It's really nice explanation of switch
Thanks
A lot of Thanks bhaiya for this tutorial playlist of c language ❤️❤️
sample program for switch case (nested):
#include
int main()
{
int b,class;
printf("enter a number b:
");
scanf("%d",&b);
printf("enter your class:
");
scanf("%d",&class);
switch (b)
{
case (45):
printf("the value is 45
");
switch (class)
{
case (12):
printf("your in class 12
");
break;
default:
break;
}
break;
case(35):
printf("the value is 35");
default:
break;
}
return 0;
}
Sir aap bahut clearly samjhate jo thank you sir 🙏🏻
#include
void main()
{int a;
printf("witch subject u have passed
");
printf("for math press 1
for scince press 2
for scince & math press 3
");
scanf("%d",&a);
switch (a)
{
case 1:
printf("u got $15");
break;
case 2:
printf("u got $15");
break;
default:
printf("u got $45");
}
}
if the user put 4 or any other key then ur program can't show any result. I suggest for any other key its show invalid key for this u put default as invalid input and add case 3. Then ur program is more better. Thank u
I don't find any sense 😐
Your code is. Invalid
error aayenga return 0 kon likhenga !
@@karansolav7275 its not at all necessary
Great explanation of switch statement❣️
BHT he easy way ma smjhaya blkol jesa ka vedio ma one way type amjhaata ha ta ka koi doubt na Raha we'll done ar thanks allot 🌸
@CodeWithHarry bhai aapp ne to mera doubt hi pura clear kardiaa BHAI
sir i am from pakistan and matric class student.sir your teaching pattern is so clearly.clearly that way because you teach everthing that could be important to us with the help of your videos you teaching your subscriber everything that they want and free of cost .this is one of the best platfarm where they founds every videos
Bro your English tells us that you are Pakistani
@@nikhilanand3447 bro your face tells us you are Indian
@@nikhilanand3447 not ethical for anybody to troll anyone for his/her second language. English doesnot bring wisdom u proved it. May u get wisdom.
@@nikhilanand3447 bro tuje itani hi ENGLISH aati hai to tu jake usse sikha
Tere ma -baap ko teri jitani English aati hai kya??????????
Welcome bro
Challenge accepted Harry
I had still seen 10 videos but they are mind blowing .I think no one is there as you Harry You r d best coder I had ever seen
love your way of explaining, i wish all my college teachers were like u but never mind.
ZAbabardast Bhttt acha sa smjhaya apna ❤
Beginners ka lia asaan ar b ha ar easily smjh b sakt ha zeda complicated way ma nai smjhaya just like other RUclipsrs
#include
int main()
{
int age,percent;
printf("ENTER YOUR AGE BETWEEN 10 TO 15
");
scanf("%d",&age);
switch (age)
{
case 10:
printf("you should be in 5th class now
");
break;
case 11:
printf("you should be in 6th class now");
break;
case 12:
printf("you should be in 7th class now");
break;
case 13:
printf("you should be in 8th class now");
break;
case 14:
printf("you should be in 9th class now");
break;
case 15:
printf("you should be in 10th class now");
break;
default:
printf("i have no information about this age class");
break;
}
return 0;
}
percent variable is useless....you didn't use it ..in 4th line (int age,percent;) should be (int age;)😄
should be in 4th line
Scanf("%d", &age,& percent);
Bro If by default has executed then break no needed I think 🤔
This program is not executed
@@shivamchopra9885 Why?
harry bro keep in mind u r writing a program of a case sensitive language so while u were teaching u wrote Switch(a)...Sorry to say ...You are a god to me and ofc the best fking teacher in this world
Powerful classes of C programming
I think you are the master in c programming language , great explanation thanks "a lot"
What is think , he is the master😉 of c programming
@@nikhilbhamare5497 GOD OF C😎😎😎😎😎😎
Ek calculater bana ne ki kosis kar raha tha sir..apke sare videos bahat ache he aur easy he rehta he..thank you so much.
#include
int main()
{
int a,b,c;
float r;
printf("Enter 2 numbers: ");
scanf("%d%d",&a,&b);
printf("
1) Addition");
printf("
2) Substraction");
printf("
3) Multiplication");
printf("
4) Divison");
printf("
5) Modulos");
printf("
6) Exit");
printf("
Enter your Choice:- ");
scanf("%d",&c);
switch(c)
{
case 1:
{
r=a+b;
break;
}
case 2:
{
r=a-b;
break;
}
case 3:
{
r=a*b;
break;
}
case 4:
{
r=a/b;
break;
}
case 5:
{
r=a%b;
break;
}
case 6:
{
break;
}
default:
{
printf("Wrong Entry");
break;
}
}
printf("Your Answer is %f
",r);
}
hi bro i am lucky my age is 12 year i am big fan of you and i have watch your every video now i am learning C i have learned it 50% from your videos and i am taking out notes thanks bro
aap itna achhe se smjhate h fir bhi aap ke video pr likes kam q aate h ?
aapke sabhi videos superb h 👌👌👌👌👍👍👍👍
kyo ki sir hindi main padate hi
#include
int main () {
int a;
printf("your roll no is ") ;
Scanf("%d", &a) ;
Switch (a) {
Case 1:
printf(" Your name is prachi") ;
break;
Case 2:
printf(" Your name is sakshi") ;
break;
Case 3:
printf(" Your name is Tushar") ;
break;
default :
printf("roll no is incorrect") ;
break;
}
return 0;
}
Bhai app kon se code editor ka use krte h
@@virtual_space399 Visual Studio
Pura course kar diya apne?
#include
int main()
{
int marks;
printf("Enter your marks in programming and data structures");
scanf("%d",&marks);
switch(marks)
{case(90):
printf("GOOD
");
break;
default:
printf("Focus on your weaknesses
");
break;
}
printf("End
");
return 0
}
Code for checking whether a triangle is right angled or not
#include
int main()
{
int A,H,P,B;
printf("Enter the length of sides of triangle
Enter larger length first
");
scanf("%d%d%d",&H,&B,&P);
A = H*H - (B*B +P*P);
switch(A)
{
case 0 :
printf("Triangle is Right angled triangle");
break;
default :
printf("Triangle is not Right angled");
}
return 0;
}
what if i entered base insted of hypotenuse in the first place
@@yashshukla9590 that's why i wrote their to enter larger side first i.e. hypotenuse
Ur code means if area is 0 it's a right angled?? That doesn't make sense, explain pls
@@dorothy4407 Area is not used. A is not area but a variable to check validity of Pythagoras theorem. We can add another case for that if the sides zero that means it is a point.
This code won't show any output
👇🏻 This is the right code
#include
int main() {
int A,H,P,B;
printf ("enter the length of the sides of a triangle
First enter the largest ones length
");
scanf("%d,%d,%d",&H,&P,&B);
printf("A=%d
",H*H-(P*P+B*B),&A);
switch(A)
{
case 0:
printf("this is a rightangled triangle
");
break;
default:
printf("this is not a right angled triangle");
}
return 0;
}
#include
int main()
{
int age;
scanf("%d
", &age);
printf("enter your age
",age);
switch(age)
{
case 2:printf("your age is 45");
break;
case 3:printf("your age is below 30");
break;
default:printf("your age is not match");
}
return 0;
}
My code I am beginner
🙄 if person input 2 then it will show your age is 45 I think so you should improve this one 🙏
Printf will come before scanf u should improve this thing also 🙏🙏😊😊
I am also a beginner 👍👍🤘🤞
Bro if a person input his /her age 2 then account to your program he's 45 year old :(
you are really awesome sir,thnku for all your effects..
Ho gaya ho gaya ho gaya 🤩jalso padi gyo baapu 💪🤜🤛
#include
Int main()
{
Int age, weight;
Printf("enter the age
");
Scanf("%d",age);
Printf("Enter the weight
");
Scanf("%d",weight);
Switch (age)
Case14
Printf(" the age is 14");
Switch( Weight)
Case 27
Printf("Enter the weight");
Break;
Default
Printf("the age and weight are match");
}
Hi Sir, Great Explanation of switch statement. Thank you so much.
Thanks Sadam!
Sir, aap awar exercise banaye ge. Bahut maza hai ex main.
@@CodeWithHarry Harry bhaiya jo aapne practice ke liye work diya tha c program ka jisame : math=15, science=15, math& science=45 prize Dena tha
Value me math science dalne par error Bata Raha hai but nomber dalne par run karta hai
ye mujhe
samajh me nahi aa Raha hai
Please mujhe jarur bataiyega
@@hindishorts593 same here bro
@@hindishorts593 pls solve this problem bhai
Dear harry sir i am learning from your c language course and this is fabulous thank you
thank you bhiya for this course. you are great
Char a
Printf("enter your name");
Scanf ("%d",&a);
Switch (a)
{
Case(sky):
Printf("your name is sky");
Break;
Default
Printf("your age is not defined");
}
Return 0;
}
%c
Aapky video dekh kr dobra dekhne ky jrurat he nhi pdti 😂 I make a lot of program for my xgf in fun way this is just like game 😂 I I'll injoy your every video 🥰and programming is so funny also 😂😂
Beta aap galat platform par aa gaye ho. Aap whitehat junior par hi seemit rahe... Aur itna na hi hase toh behtar..
Stress buster..ty bhai
thank you sir aapne acha Samjaya ek ek karke sub samj raha hai if else toh samj aagya abhi switch bhi samj gya.❤❤❤❤💯💯💯
{
int weight;
printf("Enter your weight
");
scanf("%d", &weight);
switch (weight)
{
case 10:
printf("You can go for moonwalker ride
");
break;
default:
printf("Your weight is not appropriate, you cant go for the ride
");
break;
}
}
#include
Int main( )
{
Int age;
Printf("enter your age :");
Scanf("%d",&age );
Switch(age ){
Case 18 :
Printf(" preadult ");
break
Case 10:
Printf("young");
break;
Case 60:
Printf("old");
default :
Prrintf("invalid age ");
}
return 0;
}
your explanation is excellent
if,else and switch
#include
int main()
{
int age, le;
printf("Enter your age to test drive
");
scanf("%d",&age);
if (age
Bhai ye escape sequence
ok ka mtlb kya hai jo tumne printf statement ke andar likha h shuruvat me
@@jyotiranjankunda1428 bro vo
ok nhi hai
he hai bas inhone
k bad whitespase nhi deye hai ko kam
ka he kare ga
@@jyotiranjankunda1428
ke bad jobhi Likha hota Hain wo new line me Chala jata hain
@@_RajatDhullCSB 🤔
@@jyotiranjankunda1428/n ka mtlb new line hai
ok
Created by Dewanshu..
#include
int main()
{
int number;
printf("enter the number from 0 to 5:
");
scanf("%d",&number);
//enter the number for knew about your personality
int year;
printf(" enter the year from 2000-17:
");
scanf("%d",&year);
//it's just an example
switch(number)
{
case 0:
printf("Personality:Kind
");
switch(year)
{
case 2000:
printf("the year is : 2000");
break;
case 2001:
printf("the year is : 2001");
break;
case 2002:
printf("the year is : 2002");
break;
default:
printf("The year is not appropriate");
}
break;
case 1:
printf("Personality:generous
");
switch(year)
{
case 2003:
printf("the year is : 2003");
break;
case 2004:
printf("the year is : 2004");
break;
case 2005:
printf("the year is : 2005");
break;
default:
printf("The year is not appropriate");
}
break;
case 2:
printf("Personality:Responsible
");
switch(year)
{
case 2006:
printf("the year is : 2006");
break;
case 2007:
printf("the year is : 2007");
break;
case 2008:
printf("the year is : 2008");
break;
default:
printf("The year is not appropriate");
}
break;
case 3:
printf("Personality:Helpful
");
switch(year)
{
case 2009:
printf("the year is : 2009");
break;
case 2010:
printf("the year is : 2010");
break;
case 2011:
printf("the year is : 2011");
break;
default:
printf("The year is not appropriate");
}
break;
case 4:
printf("Personality:Clever
");
switch(year)
{
case 2012:
printf("the year is : 2012");
break;
case 2013:
printf("the year is : 2013");
break;
case 2014:
printf("the year is : 2014");
break;
default:
printf("The year is not appropriate");
}
break;
case 5:
printf("Personality:Smart
");
switch(year)
{
case 2015:
printf("the year is : 2015");
break;
case 2016:
printf("the year is : 2016");
break;
case 2017:
printf("the year is : 2017");
break;
default:
printf("The year is not appropriate");
}
break;
default:
printf("The number is not appropriate");
}
return 0;
}
Bro please check it and tell me how can I use character Data type in this format.
Thank u so much harry vai
Btw
Love u from bangladesh
😚😚
No doubt at all 🔥🔥❤️
1$t from Manish Aryan
if i didn' t used the break command, then default will be executed , that's seems logical. but why other cases are also executed in output.They should not be executed because , how does one entry can satisfy the conditions of all case.??????
When we don't use break... It doesn't mean it's satisfying remaining cases.... It just executes all statements... As a result, anything inside printf() function display on terminal
/* Date-5/1/2022
Author Name-Achyut Agrahari
Purpose=for Learning Code
The code is about switch satements*/
int main()
{
int a;
printf("Cutoff For Admission In BCA
" );
printf("Enter your category code
");
printf("Enter 1 for unreserved category
");
printf("Enter 2 for EWS category
");
printf("Enter 3 for OBC category
");
printf("Enter 4 for SC/ST category
");
scanf("%d",&a);
switch (a)
{
case 1:
printf("Enter your marks
");
scanf("%d",&a);
if (a>=160)
{
printf("you are selecteted
");
}
else
printf("Wait for next cutoff
");
break;
case 2:
printf("Enter your mark
");
scanf("%d",&a);
if (a>=150)
{
printf("you are selecteted
");
}
else
printf("Wait for next cutoff
");
break;
case 3:
printf("Enter your mark
");
scanf("%d",&a);
if (a>=142)
{
printf("you are selecteted
");
}
else
printf("Wait for next cutoff
");
break;
case 4:
printf("Enter your mark
");
scanf("%d",&a);
if (a>=125)
{
printf("you are selecteted
");
}
else if (a>=100)
{
printf("you are selecteted through ST catgory
");
}
else
printf("Wait for next cutoff
");
break;
default:
printf("Error
");
}
}
Scan f kaha he
Mja aaa gya 💥💥
❤
#include
int main()
{
int a;
printf("Enter the number of months
",a);
scanf("%d",&a);
switch(a){
case 2:
printf("the no. of days is 60
");
break;
case 1:
printf("the no. of days is 30");
break;
}
return 0;
}
#include
int main()
{
int num;
printf("Enter number you want");
scanf("%d",&num);
switch(num==num/2)
{
case 0:
printf("It is Even Number");
break;
default:
printf("It is Odd number");
break;
}
return 0;
}
Please promise that after C language you make videos on java or android.please.
Switch ke andhar switch, learnt new thing today, thanks Harry bhaii❤😊
#include
int main()
{
int m,marks;
printf("enter your marks
");
scanf("%d",&m);
printf("enter your total marks also
");
scanf("%d",&marks);
switch(m)
{
case 100:
printf("you go to A section
");
break;
default:
printf("These students are not decided
");
}
switch(marks)
{
case 600:
printf("you also go to A sec
");
break;
default:
printf("these students aren't decided wait
");
}
return 0;
}
your code was wrong m enter 2 number but same condition please check again i think you miss some little mistake
/*a program to demonstrate the usage of switch and case statements
1) the age should either be 16,25 or 36
2) the work experience must be 15, 20 or 25 years respectively
*/
#include
int main()
{
int age, exp ;
printf("enter your age :
");
scanf("%d",&age);
printf("enter your experience (in years)
");
scanf("%d",&exp);
switch (age){
case 16:
printf("your age is 16
");
switch (exp){
case 15:
printf("YOU ARE ELIGIBLE !");
break;
default:
printf("YOU ARE NOT ELIGIBLE, SORRY !");
}
break;
case 25:
printf("your age is 25
");
switch (exp){
case 20:
printf("YOU ARE ELIGIBLE !");
break;
default:
printf("YOU ARE NOT ELIGIBLE, SORRY !");
}
break;
case 36:
printf("your age is 36
");
switch (exp){
case 25:
printf("YOU ARE ELIGIBLE !");
break;
default:
printf("YOU ARE NOT ELIGIBLE, SORRY !");
}
break;
default:
printf("not aligible since your age is not 16, 25 or 36");
}
return 0;
}
the only that doesn't fit is that if we enter age 16 code will only sat that you are eligible particularly for exp 15 but not for above (if we are over looking the fact that how can a 16 year old have exp of 15 years lol ) also i have a question cant we use ,= these in switch statements ?
btw kind efforts 🙂
Thanks you sir, my dream is one day I'll in cyber security and I never forget in my life🔥❤️
Your every lecture are very useful for all student and you are god for me.
Mere liye bhi yaar harry bhai kya padate hai yaar vo mere liye bhagwan hai jindagi mai ek bar jarur milunga 🙏
Bro to get into cyber security what else i have to know i mean which language i has to study. And what else?
@@Hyd35 c++ , py. ect..
@@mrnavdip9560 thankyou😇
Excellent work bro
loved the video man
Harry sir You teach better than my college college professor ♥️😀
Abhi rukho iska screenshote aapke sir ko deta hu.. 😂
@@bharatsinghpatel5086 ha bhai de de sir ki burayi but harry rocks
@@uvutkarshverma 😂😂😂
I NEED A CHEAT SHEET OF
C PROGRAMMING LANGUAGES.
Codewith Harry on 🔥🔥🔥🔥🔥🔥
thanks harry bhai for sharing a great knowledge about c language
CHALLENGE ACCEPTED
#include
int main()
{
int kele,tarbooz;
printf("kitne kele chiye
");
scanf("%d",&kele);
printf("tarbooz bhi khayega kya
");
scanf("%d",&tarbooz);
switch (kele)
{
case 6:
printf("badhiya h khao
");
break;
case 12:
printf("kam khaya kar be
");
break;
case 50:
printf("janwar hi marega tu
");
switch (tarbooz)
{
case 10:
printf("gandu he kya
");
break;
default:
printf("jeele apni zindagi
");
break;
}
break;
default:
break;
}
return 0;
}
Good bro.and very funny code 👏🤣
hahahhahahahaahhhahhahhahahaha
Hahahaha 😂
Nice code ..
Funny bro
I think it's better to use break if we don't want the code to behave erratic
Thanks Harry Bhai..
Sir thanks For this tutorial videos you are great
#include
int main()
{
int a;
printf("Please Enter
1 if you are passed in maths
2 if you are passed in science
3 if you are passed in both maths and science
And 4 if you are passed in none
");
scanf("%d",&a);
switch (a)
{
case 1 :
printf("You have won rs.15
");
break;
case 2 :
printf("You have won rs.15
");
break;
case 3 :
printf("You have won rs.45
");
break;
default:
printf("Work Hard!!!!");
break;
}
return 0;
}
awsome bro
It shows error 😐
Becuase u doesn't use conio
Wellcome bruh 😇😇
I've written a menu driven program with exit , with the help of while loop .
Thank you sir , you are great.
include
int main()
{
int choice, a,b,s;
while(1)
{
printf("
1. Addition");
printf("
2. Odd-even");
printf("
3. Printing n numbers");
printf("
4. Multiplication");
printf("
5. exit");
printf("
Enter your choice : ");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("
Enter two numbers : ");
scanf("%d%d",&a,&b);
s=a+b;
printf("Sum is %d", s);
break;
case 2:
printf("
Enter a number : ");
scanf("%d", &a);
if(a%2==0)
printf("
even number");
else
printf("
odd number");
break;
case 3:
printf("
Enter a number : ");
scanf("%d", &a);
for(b=1;b
awsome
Amazing sir👍👍👍👍👍
#include
int main()
{
int roll;
printf("enter your roll
");
scanf("%d", &roll);
switch (roll)
{
case 1:
printf("congratulations! you pass the entrance exam
");
break;
case 2:
printf("you failed all the best for next time
");
break;
default:
printf("sorry we can not recognize you
");
}
return 0;
}
i am so late but i understand big brother what you teach us🥰🥰😍
#include
Int main() {
Int mark;
Printf("enter your mark
");
Scanf("%d",&mark);
Switch(mark){
Case 10:
Printf("you mark is 10 ");
Breake;
Case 40:
Printf("your mark is 40");
Break;
Case 90:
Printf("your mark is 90");
Breake;
Default:
Printf(" your mark is not 10 40 or 90");
}
Return 0;
}
Bro please understand the upper case Letters must be write in Lower case.
❤❤
// Write a C program to check whether a number is positive, negative or zero using switch case.
#include
int main ()
{
int a;
printf("
enter a number: ");
scanf("%d", &a);
switch (a > 0)
{
case 1:
printf("positive");
break;
case 0:
switch (a
Bhaiya/didi aapne
pehle lagaya hai vo last me hota hai
@@utkarshpankaj5 its not needed actually instead it could be like this
printf("Enter a number:");
scanf("%d",&a);
this will look good.
@@utkarshpankaj5 that's upto you, you can use it either in the start or middle or last 🙋♂️
Cas
BHAI LOTS OF LOVE............
I really like your way of teaching.
Superb👍
playlist
1. beliver 2.despacito 3.seniorita 4.peaches
main()
{
int n ;
printf("
enter the song number that you like ");
scanf("%d",n);
switch(n)
{
case 1 :
printf("
beliver");
break;
case 2 :
printf("
despacito");
break;
case 3 :
printf("
seniorita ");
break;
case 4:
printf("
peaches");
break;
default :
printf("
sorry , 4 songs available ");
break;
}
int main()
{
int class;
printf("enter your class")
scanf("%d",&class);
switch(class)
{
class 5:
printf("the class is 5th std");
break;
class 6:
printf("the class is 6th std");
break;
default:
printf("your class is not 3th std and 5th std");
}
return 0;
}
statement terminator after printf statement and in last not 3th it should be 6th
great explanation harry bhai
Sir u are our inspiration
#include
#include
int main(int argc, char const *argv[])
{
int x,p;
printf("Enter the value of X
");
scanf("%d", &x);
printf("And enter your age please
");
scanf("%d", &p);
switch (x)
{
case 0:
printf("Yes! 0 is the correct answer
");
printf("there are two answers of this question, please find the other answer too
");
switch (p)
{
case 23:
printf("your IQ is brilliant according to your current age
");
break;
default:
printf("Your IQ does not match according to your age
");
break;
}
break;
case 1:
printf("Yes! 1 is the correct answer
");
printf("there are two answers of this question, please find the other answer too
");
switch (p)
{
case 23:
printf("your IQ is brilliant according to your current age
");
break;
default:
printf("Your IQ does not match according to your age
");
break;
}
break;
default:
printf("your answer is incorrect
");
printf("sorry your IQ does not match with your age
");
break;
}
return 0;
}
tumne c++ ka code likha hai ya c ka?
@@padhle2184 C language ka
@@padhle2184 bhai main func ku dekh ke confuse mathhojao c he c++ nahi
@@padhle2184 nahi
// code to determine your permits according to your age//
# include
int main() {
int age;
printf("Enter your age
");
scanf("%d", &age);
switch (age)
{
case 20
:
printf("You can make your own decions
");
// break;
case 18 :
printf("You can drive a vehicle
");
// break;
case 15:
printf("You can go out with friends
");
// break;
case 10:
printf("You can watch a movie
");
// break;
case 5:
printf("You can interact with people
");
break;
default:
printf("Are you even born ");
break;
}
return 0;
}
meme material type code
my parents use this code in my real life
Waah kya code hai🤣🤣
#include
int main()
Char ch;
frintf("enter charactor);
Scanf("%c",&ch);
Switch(ch)
{
case 'a' : printf("vowel");
break;
default:printf("uconsoment");
}
return 0;
}
Thankyou Harry bhaiya
#include
int main(int argc, char *argv[])
{
int year;
printf("Enter the year ");
scanf("%d", &year);
switch (year)
{
case 1983:
printf("India win 1st world cup");
break;
case 2007:
printf("India win 1st T20 world cup");
break;
case 2011:
printf("India lifts the world cup after 28 years");
break;
default:
printf("Unlucky indian team");
}
}
Crrct
Not correct bro , jab bhi "int main" use karte hai toh last me ek value return hona chaheye , in this case it should be , return 0; , that's why it will not be executed , rest all is correct , gr8 job
@@ritesh1480 bro par agar ham dev c++ use kar rahe he too hame return value likhne ki jaroorat nahi he kyu ki vo compiler automaticly hi return value dedeta he
Double Lena tha int q le liya 4 num hai
@@omsoni6706 right
// a code for school purposes
#include
int main(int argc, char const *argv[])
{
int a, b;
printf("Enter your class[6,7,8]
-->");
scanf("%d", &a);
printf("Enter your marks [MM-80]
-->");
scanf("%d", &b);
switch (a)
{
case 6:
printf("ok......
");
if (b > 32 && b < 80)
{
printf("Passed!!
");
}
else if (b < 32)
{
printf("Failed!!
");
}
else
{
printf("Wrong input!!!
");
}
break;
case 7:
printf("ok......
");
if (b > 40 && b < 80)
{
printf("Passed!!
");
}
else if (b < 40)
{
printf("Failed!!
");
}
else
{
printf("Wrong input!!!
");
}
break;
case 8:
printf("ok......
");
if (b > 42 && b < 80)
{
printf("Passed!!
");
}
else if (b < 42 && b < 80)
{
printf("Failed!!
");
}
else
{
printf("Wrong input!!!
");
}
break;
default:
printf("You have entered wrong class!!
");
break;
}
return 0;
}
// i know its long enough but can be helpful
Bro I got error in my code can uh please help me😕
@@Lafhdajhalare bro what is the error?
have you tried my code?
Thank U sir always
This video is helping me in 2022
#include
#include
void main()
{
int height;
clrscr();
printf("Enter your Height..(4,5,6)
");
scanf("%d
",&height);
switch (height){
case 4:
printf("Your height is 4 feet
");
break;
case 5:
printf("Your height is 5 feet");
break;
case 6:
printf("Your height is 6 feet");
break;
default:
printf("Sorry you enterd wrong digits..");
}
getch();
}
It seems like you coded in turbo C compiler☺☺☺
Y u wrote that in scanf (/n)
It mean u will go for next line
U can write it after &height .
Exactly harry sir your so genius
Sir please make a video on menu driven program to perform arithmetic operations
#include
#include
void main()
{
clrscr();
int choice;
printf("fields available
1.BCCA
2.BCOM
3.BSC
-------------------------------------------
");
printf("enter the field you want to get graduated with:");
scanf("%d", &choice);
switch (choice)
{
case 1:
printf("your choice is BCCA");
break;
case 2:
printf("your choice is BCOM");
break;
case 3:
printf("your choice is BSC");
break;
default:
printf("invalid field name, enter the number of field i.e. 1,2 or 3");
}
getch();
}
Thank you sir , you are great.
include
int main()
{
int choice, a,b,s;
while(1)
{
printf("
1. Addition");
printf("
2. Odd-even");
printf("
3. Printing n numbers");
printf("
4. Multiplication");
printf("
5. exit");
printf("
Enter your choice : ");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("
Enter two numbers : ");
scanf("%d%d",&a,&b);
s=a+b;
printf("Sum is %d", s);
break;
case 2:
printf("
Enter a number : ");
scanf("%d", &a);
if(a%2==0)
printf("
even number");
else
printf("
odd number");
break;
case 3:
printf("
Enter a number : ");
scanf("%d", &a);
for(b=1;b
While(1) ku use kiya hai timne?
Copied comment
Mysirg se copy hey🙃
Can we create a normal calculator using switch......???????
@@ashutoshpradhan123 yes
//Hope you like the code SIr
int age;
printf("Please enter your age");
scanf("%d", &age);
switch (age)
{
case 5:
printf("You are too small for driving");
case 10:
printf("You are too small for driving");
break;
case 14:
printf("You are not too small for driving");
case 17:
printf("You are just about to pass age for driving");
break;
case 18:
printf("You can drive");
default:
printf("Cannot find your age");
break;
}
Love you sir .this course is very awesome
#include
int main()
{
int number;
printf("enter your value/n");
scanf("%d",&number);
switch (number)
{
case 1:
printf("you have passed in maths ");
break;
case 2:
printf("you have passed in science");
break;
case 3:
printf("you have passed in both in maths and science") ;
break;
default:
printf("you are not elligible to seat in the exam");
break;
}
}
Bro muze activation extension nahi dikha raha hai kya karu