Switch Case Control Statements In C: C Tutorial In Hindi #11

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

ความคิดเห็น • 1.7K

  • @CodeWithHarry
    @CodeWithHarry  5 ปีที่แล้ว +744

    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!

    • @AdarshKumar-lf1kf
      @AdarshKumar-lf1kf 5 ปีที่แล้ว +13

      Perfect
      ..

    • @AdarshKumar-lf1kf
      @AdarshKumar-lf1kf 5 ปีที่แล้ว +11

      Notes kb se aayegi

    • @RiyaSingh-eg9qr
      @RiyaSingh-eg9qr 5 ปีที่แล้ว +16

      its going normal

    • @jyotitiwari3134
      @jyotitiwari3134 5 ปีที่แล้ว +11

      Sir array aur pointer thoda aur brief description De dijiye Jisey bade program bhi try kr sake

    • @_inspireverse___
      @_inspireverse___ 5 ปีที่แล้ว +4

      Very nice explanation sir? Mere saare doubts clear ho gaye. Thank you sir!

  • @ls12394
    @ls12394 ปีที่แล้ว +115

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

    • @OG_Yash10
      @OG_Yash10 11 หลายเดือนก่อน +3

    • @roshangaming2772
      @roshangaming2772 5 หลายเดือนก่อน +1

      Galat h bhai

    • @factsandknowledge8954
      @factsandknowledge8954 3 หลายเดือนก่อน

      @@roshangaming2772 KYA

    • @KrishnaGoswami-r6k
      @KrishnaGoswami-r6k 3 หลายเดือนก่อน +2

      ​@@roshangaming2772 kese ?

    • @KARTIKOGYT
      @KARTIKOGYT 14 วันที่ผ่านมา

      ​@@roshangaming2772hmm isme case 1,2,3 ana chaiyeh instead of 40,50or60.

  • @NitinKumar-gq7yr
    @NitinKumar-gq7yr 2 ปีที่แล้ว +296

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

    }

  • @shubhamjaiswal2322
    @shubhamjaiswal2322 5 ปีที่แล้ว +43

    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.

  • @dnyaneshwargaikwad6788
    @dnyaneshwargaikwad6788 3 ปีที่แล้ว +65

    {
    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;
    }

  • @vindeshshukla4079
    @vindeshshukla4079 ปีที่แล้ว +5

    #include
    int main()
    {
    int marks;
    printf ("enter your marks
    ");
    scanf("%d",&marks);
    Switch (marks)
    {
    Case 45:
    printf("your marks is 45");
    break;
    Case 99:
    printf ("your marks is 99");
    break;
    default:
    printf ("your marks is not 45 and 99");
    break;
    }
    return 0;
    }

  • @sineparadox98
    @sineparadox98 3 ปีที่แล้ว +6

    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.

  • @nizamuddinhameed5249
    @nizamuddinhameed5249 ปีที่แล้ว +3

    #include
    int main()
    {
    int shoes;
    printf("Guess the number of pairs of shoes i have");
    scanf("%d", &shoes);
    switch(shoes)
    {
    case 2:
    printf("You've 2 pairs of shoes);
    break;
    case 3:
    printf("You've 3 pairs of shoes);
    break;
    case 4:
    printf("You've 4 pairs of shoes);
    break;
    default:
    printf("You've give the wrong answer")
    }
    }

  • @chaudharyshoeb8459
    @chaudharyshoeb8459 5 ปีที่แล้ว +10

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

  • @Basigma-g3e
    @Basigma-g3e 2 ปีที่แล้ว +145

    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

    • @nikhilanand3447
      @nikhilanand3447 2 ปีที่แล้ว +64

      Bro your English tells us that you are Pakistani

    • @professor2250
      @professor2250 2 ปีที่แล้ว +22

      @@nikhilanand3447 bro your face tells us you are Indian

    • @anshumanraturi
      @anshumanraturi 2 ปีที่แล้ว +49

      @@nikhilanand3447 not ethical for anybody to troll anyone for his/her second language. English doesnot bring wisdom u proved it. May u get wisdom.

    • @parmardharmik4731
      @parmardharmik4731 2 ปีที่แล้ว

      @@nikhilanand3447 bro tuje itani hi ENGLISH aati hai to tu jake usse sikha
      Tere ma -baap ko teri jitani English aati hai kya??????????

    • @memematerial4205
      @memematerial4205 2 ปีที่แล้ว +2

      Welcome bro

  • @24_cst3_eshagunjekar7
    @24_cst3_eshagunjekar7 3 ปีที่แล้ว +27

    As a beginner I was unable to understand .But your vidoes are seriously soo good, very easy to understand ❤ Also thankyou for your vlogs.

  • @nikhilraj1842
    @nikhilraj1842 5 ปีที่แล้ว +195

    // 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;
    }

  • @nikitaraut2747
    @nikitaraut2747 ปีที่แล้ว +14

    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

  • @hetmalani1795
    @hetmalani1795 ปีที่แล้ว +1

    #include #include
    int main()
    {
    Int age;
    printf("enter age:");
    Scanf("%d",age);
    Switch(a) {
    case 20: printf("they can drive");
    break;
    case. 15:printf("they can enjoy ");
    break;
    Case 22: printf("they can marrige");
    break;
    Defaulat :
    Printf(" they can nothing")
    }
    Return 0;
    }

  • @ajaymohankar5912
    @ajaymohankar5912 4 ปีที่แล้ว +64

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

    • @abdularhamjamal8957
      @abdularhamjamal8957 3 ปีที่แล้ว +19

      percent variable is useless....you didn't use it ..in 4th line (int age,percent;) should be (int age;)😄

    • @1plusspace568
      @1plusspace568 3 ปีที่แล้ว +1

      should be in 4th line
      Scanf("%d", &age,& percent);

    • @CEB-AMITKUMAR
      @CEB-AMITKUMAR 2 ปีที่แล้ว +4

      Bro If by default has executed then break no needed I think 🤔

    • @NaveenSharmaJii
      @NaveenSharmaJii 2 ปีที่แล้ว +1

      This program is not executed

    • @Sunny-qy1fj
      @Sunny-qy1fj 2 ปีที่แล้ว +3

      you need to take another switch in every case and put percent according too your mind

  • @Hariom-ix5wr
    @Hariom-ix5wr 2 ปีที่แล้ว +1

    #include
    int main()
    {
    Char ch;
    printf("enter any ch");
    scanf("%c",&ch);
    switch (ch);
    {
    Case'a';
    printf("vowel");
    break;
    case'e';
    printf("vowel");
    break;
    case'i';
    printf("vowel");
    break;
    Case'o';
    printf("vowel");
    break;
    Case'u';
    printf("vowel";
    break;
    dafacult;
    printf ("consonant");
    return 0;
    }

  • @uditnathprasad5612
    @uditnathprasad5612 8 หลายเดือนก่อน +10

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

    • @NetworkingBasic-j4v
      @NetworkingBasic-j4v 2 หลายเดือนก่อน +2

      you forgot to include break

    • @apt7660
      @apt7660 12 วันที่ผ่านมา +1

      Yeah he forgot to put break after case 10

  • @virajdhakane440
    @virajdhakane440 2 ปีที่แล้ว +1

    #include
    int main()
    Char ch;
    frintf("enter charactor);
    Scanf("%c",&ch);
    Switch(ch)
    {
    case 'a' : printf("vowel");
    break;
    default:printf("uconsoment");
    }
    return 0;
    }

  • @iitduniya
    @iitduniya 10 หลายเดือนก่อน +205

    Kon kon 2024 me dekh raha hai❤❤

  • @Mrhit2o2
    @Mrhit2o2 ปีที่แล้ว +1

    #include
    int main()
    {
    int class;
    printf("Enter your class
    ");
    scanf("%d"&class);
    switch(class){
    case 3;
    printf("your class is 3");
    break;
    case 5;
    printf("your class is 5");
    break;
    default;
    printf("you are not 5 or 3");
    }
    return 0;
    }

  • @mridulamal7748
    @mridulamal7748 ปีที่แล้ว +5

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

  • @nihaltabbalaji5340
    @nihaltabbalaji5340 2 ปีที่แล้ว +5

    #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");
    }

  • @arjunkendre4656
    @arjunkendre4656 5 ปีที่แล้ว +30

    #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

    • @akashagrawal2645
      @akashagrawal2645 3 ปีที่แล้ว +1

      🙄 if person input 2 then it will show your age is 45 I think so you should improve this one 🙏

    • @nileshrajbhar9263
      @nileshrajbhar9263 3 ปีที่แล้ว +4

      Printf will come before scanf u should improve this thing also 🙏🙏😊😊

    • @nileshrajbhar9263
      @nileshrajbhar9263 3 ปีที่แล้ว +1

      I am also a beginner 👍👍🤘🤞

    • @SUNNYVLOGS812
      @SUNNYVLOGS812 3 ปีที่แล้ว

      Bro if a person input his /her age 2 then account to your program he's 45 year old :(

  • @manishyadav-lz1hi
    @manishyadav-lz1hi ปีที่แล้ว +1

    #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🥰🥰😍

  • @imamuddinansari2917
    @imamuddinansari2917 5 ปีที่แล้ว +25

    aap itna achhe se smjhate h fir bhi aap ke video pr likes kam q aate h ?
    aapke sabhi videos superb h 👌👌👌👌👍👍👍👍

  • @tuneflix7252
    @tuneflix7252 2 ปีที่แล้ว +13

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

    • @virtual_space399
      @virtual_space399 2 ปีที่แล้ว +1

      Bhai app kon se code editor ka use krte h

    • @tuneflix7252
      @tuneflix7252 2 ปีที่แล้ว

      @@virtual_space399 Visual Studio

    • @sine-sine4530
      @sine-sine4530 2 ปีที่แล้ว

      Pura course kar diya apne?

  • @girishdhakar401
    @girishdhakar401 ปีที่แล้ว +1

    #include
    int main(){
    int runs;
    printf("how many runs scored:");
    scanf("%d",&runs);
    switch(runs){
    case 50:
    printf("virat played a fabulous inning of 50 runs
    ");
    break;
    case 100:
    printf("virat played a fabulous inning of 100 runs
    ");
    break;

    default:
    printf("virat neither scored 50 nor 100 runs
    ");
    }
    return 0;
    }

  • @it-27utkarshawarbhe28
    @it-27utkarshawarbhe28 2 ปีที่แล้ว +3

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

  • @preetmonga436
    @preetmonga436 2 ปีที่แล้ว +11

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

    • @yashshukla9590
      @yashshukla9590 ปีที่แล้ว

      what if i entered base insted of hypotenuse in the first place

    • @preetmonga436
      @preetmonga436 ปีที่แล้ว

      @@yashshukla9590 that's why i wrote their to enter larger side first i.e. hypotenuse

    • @dorothy4407
      @dorothy4407 ปีที่แล้ว

      Ur code means if area is 0 it's a right angled?? That doesn't make sense, explain pls

    • @preetmonga436
      @preetmonga436 ปีที่แล้ว +2

      @@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.

    • @titlegamerz8156
      @titlegamerz8156 ปีที่แล้ว

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

  • @Simran-dm3ge
    @Simran-dm3ge ปีที่แล้ว +13

    {
    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;
    }
    }

  • @SadamHussain-zj9ei
    @SadamHussain-zj9ei 5 ปีที่แล้ว +73

    Hi Sir, Great Explanation of switch statement. Thank you so much.

    • @CodeWithHarry
      @CodeWithHarry  5 ปีที่แล้ว +34

      Thanks Sadam!

    • @SadamHussain-zj9ei
      @SadamHussain-zj9ei 5 ปีที่แล้ว +2

      Sir, aap awar exercise banaye ge. Bahut maza hai ex main.

    • @hindishorts593
      @hindishorts593 4 ปีที่แล้ว +9

      @@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

    • @karateandextratips4487
      @karateandextratips4487 4 ปีที่แล้ว

      @@hindishorts593 same here bro

    • @karateandextratips4487
      @karateandextratips4487 4 ปีที่แล้ว

      @@hindishorts593 pls solve this problem bhai

  • @rishabsharma5521
    @rishabsharma5521 3 ปีที่แล้ว +9

    Hey Harry I'm literally watching your videos and actually it's easy to learn and I can easily implement in programs.

  • @Da_bing77-d77
    @Da_bing77-d77 9 หลายเดือนก่อน

    #Include
    Int main()
    {
    Int x;
    printf("enter a number");
    scanf("%d",&x);
    Switch(x)
    Case 1:printf("Monday");
    break;
    case 2:printf("Tuesday");
    break;
    case 3:printf("Thursday");
    break;
    case 4:printf("Friday");
    break;
    case 5:printf("Saturday");
    break;
    case 6:printf("Wednesday");
    break;
    case 7:printf("Sunday");
    break;
    default : printf("not a valid day");

  • @swagatamhazra1910
    @swagatamhazra1910 3 ปีที่แล้ว +21

    Harry sir You teach better than my college college professor ♥️😀

    • @bharatsinghpatel5086
      @bharatsinghpatel5086 3 ปีที่แล้ว +1

      Abhi rukho iska screenshote aapke sir ko deta hu.. 😂

    • @uvutkarshverma
      @uvutkarshverma 3 ปีที่แล้ว +1

      @@bharatsinghpatel5086 ha bhai de de sir ki burayi but harry rocks

    • @akib_zaved7169
      @akib_zaved7169 3 ปีที่แล้ว

      @@uvutkarshverma 😂😂😂

  • @divyashreechandrana9560
    @divyashreechandrana9560 2 ปีที่แล้ว +10

    // 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

    • @utkarshpankaj5
      @utkarshpankaj5 2 ปีที่แล้ว +1

      Bhaiya/didi aapne
      pehle lagaya hai vo last me hota hai

    • @ashish4k07
      @ashish4k07 2 ปีที่แล้ว +1

      @@utkarshpankaj5 its not needed actually instead it could be like this
      printf("Enter a number:");
      scanf("%d",&a);
      this will look good.

    • @deepsahil__
      @deepsahil__ 2 ปีที่แล้ว

      @@utkarshpankaj5 that's upto you, you can use it either in the start or middle or last 🙋‍♂️

    • @Anasboss744
      @Anasboss744 2 ปีที่แล้ว

      Cas

  • @mraduldixit1736
    @mraduldixit1736 ปีที่แล้ว +2

    /*
    For check month is Jan,Feb or any other month from the year
    */
    #include
    #include
    int main()
    {
    int mth;
    printf("Enter Month=
    ");
    scanf("%d",&mth);
    switch(mth)
    { case 31:
    printf("entered month is Jan");
    break;
    case 28:
    printf(" Its Feb ");
    break;
    default:
    printf("Any other month in the year
    ");
    }
    getch();
    return 0;
    }

  • @ashishbalyan835
    @ashishbalyan835 3 ปีที่แล้ว +6

    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 😂😂

    • @los_pollos_hermanos_
      @los_pollos_hermanos_ 3 ปีที่แล้ว +1

      Beta aap galat platform par aa gaye ho. Aap whitehat junior par hi seemit rahe... Aur itna na hi hase toh behtar..

  • @sauravkumarsingha5991
    @sauravkumarsingha5991 ปีที่แล้ว

    I am really new in this batch. I didn't have a tiny prior knowledge on the language. I have started watching last week.
    whatever I have learnt till now, its for you. Thank you. My code:
    #include
    int main()
    {
    int choice;
    printf("welcome to the \'15 din me paisa double Bank\'
    ");
    printf("choose an option
    ");

    printf("1. Balance Inquiry
    ");
    printf("2. Cash Deposite
    ");
    printf("3. Cash Withdrawl
    ");
    printf("4. Exit
    ");
    scanf("%d", &choice);
    switch (choice)
    {
    case 1:
    printf("Your balance is 112350365.00
    ");
    break;
    case 2:
    printf("Press your account number
    ");
    break;
    case 3:
    printf("
    Savings
    Current
    ");
    break;
    default:
    printf("Thank you for trusting us
    ");
    }
    return 0;
    }

  • @MdShahid-rb8nc
    @MdShahid-rb8nc 2 ปีที่แล้ว +15

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

  • @achyutagrahari2008
    @achyutagrahari2008 2 ปีที่แล้ว +25

    /* 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
    ");
    }
    }

  • @Taruunn25
    @Taruunn25 3 หลายเดือนก่อน

    Include
    Int (main)
    [
    Int name;
    Printf("enter the name"/n);
    Scanf("%d/n" , &name);
    Switch
    Case tanu;
    Printf("your name is tanu/n");
    Break;
    Default
    Printf("your name is tanu");
    Default (

  • @PriyaGupta-sg4sm
    @PriyaGupta-sg4sm 2 ปีที่แล้ว +7

    /*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;
    }

    • @arunrana-ch2zd
      @arunrana-ch2zd ปีที่แล้ว

      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 🙂

  • @pranitdaphale6409
    @pranitdaphale6409 2 ปีที่แล้ว +10

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

  • @adityatripathi2178
    @adityatripathi2178 3 ปีที่แล้ว +7

    // 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;
    }

    • @BeingAllinOneLive
      @BeingAllinOneLive 3 ปีที่แล้ว +1

      meme material type code

    • @BeingAllinOneLive
      @BeingAllinOneLive 3 ปีที่แล้ว +2

      my parents use this code in my real life

    • @kon_humein
      @kon_humein 2 ปีที่แล้ว

      Waah kya code hai🤣🤣

  • @arjitdubey-r2f
    @arjitdubey-r2f 11 หลายเดือนก่อน

    #include
    int main()
    {
    int a,wt
    printf("enter the weight");
    scanf("%d"&wt);
    a=50;
    switch(a){
    case 50:
    printf("weight is ok");
    break;
    case 80:
    printf("need special diet plan");
    break;
    case 100:
    printf("over weight");
    break;
    default;
    return 0;
    }

  • @mkstates6246
    @mkstates6246 4 ปีที่แล้ว +4

    Sir aap bahut clearly samjhate jo thank you sir 🙏🏻

  • @rohanmasne1209
    @rohanmasne1209 3 ปีที่แล้ว +3

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

  • @AdityaPrakashVlogs_14
    @AdityaPrakashVlogs_14 2 ปีที่แล้ว +1

    program to check the grade of students by taking input of their marks:=
    #include
    int main(){
    int marks;
    printf("enter your marks= ");
    scanf("%d", &marks);
    switch (marks)
    {
    case 90:
    printf("the Grade is = A
    ");
    break;
    case 80:
    printf("the Grade is = B
    ");
    break;
    case 70:
    printf("the Grade is = C
    ");
    break;
    case 60:
    printf("the Grade is = D
    ");
    break;
    case 50:
    printf("the Grade is = E
    ");
    break;
    case 40:
    printf("FAIL
    ");
    break;
    default:
    printf("the grade Unknown");
    break;
    }
    return 0;
    }

  • @rasikashahapure6777
    @rasikashahapure6777 9 หลายเดือนก่อน +1

    #include
    int main()
    {
    int day;
    printf("Enter your day
    ");
    scanf("%d", &day);
    switch (day)
    {
    case 1:
    printf("The day is Monday");
    break;
    case 2:
    printf("The day is Tuesday");
    break;
    case 3:
    printf("The day is Wednesday");
    break;

    case 4:
    printf("The day is Thursday");
    break;

    case 5:
    printf("The day is Friday");
    break;

    case 6:
    printf("The day is Saturday");
    break;

    case 7:
    printf("The day is Sunday");
    break;
    default:
    printf("Not a day");
    break;
    }

    return 0;
    }

  • @ManishRashtraputMaths
    @ManishRashtraputMaths 5 ปีที่แล้ว +19

    1$t from Manish Aryan

  • @mrnavdip9560
    @mrnavdip9560 3 ปีที่แล้ว +19

    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.

    • @geteverything8252
      @geteverything8252 2 ปีที่แล้ว +2

      Mere liye bhi yaar harry bhai kya padate hai yaar vo mere liye bhagwan hai jindagi mai ek bar jarur milunga 🙏

    • @Hyd35
      @Hyd35 2 ปีที่แล้ว +3

      Bro to get into cyber security what else i have to know i mean which language i has to study. And what else?

    • @mrnavdip9560
      @mrnavdip9560 2 ปีที่แล้ว +3

      @@Hyd35 c++ , py. ect..

    • @Hyd35
      @Hyd35 2 ปีที่แล้ว +1

      @@mrnavdip9560 thankyou😇

  • @manishKumar-tl2ee
    @manishKumar-tl2ee 4 ปีที่แล้ว +6

    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.??????

    • @abdussamipatel7901
      @abdussamipatel7901 4 ปีที่แล้ว

      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

  • @iamstudying389
    @iamstudying389 11 หลายเดือนก่อน +5

    pov: you are learning your first language in your semester break

  • @princekori6231
    @princekori6231 ปีที่แล้ว +1

    #include
    int main()
    {
    Char ch;
    printf("enter an alphabet ") ;
    scanf("%c", &ch") ;
    switch(ch)
    {
    Case 'a':
    printf(" vowel") ;
    break;
    case 'i':
    printf("vowel");
    break;
    case 'o':
    printf("vowel");
    break;
    case 'e':
    printf("vowel");
    break;
    case 'u':
    printf("vowel");
    break;
    default:
    {
    printf("consonant") ;
    }
    }
    return 0;
    }

  • @UmeshBaba555
    @UmeshBaba555 10 หลายเดือนก่อน

    #include
    Int main(){
    Int day;
    Printf(" Enter your day");
    Scanf("%d",day);
    Switch (day){
    Case Monday:
    Printf("Today Monday");
    Case :
    Printf("Today Monday");
    Case Monday:
    Printf("Today Monday");
    Case Monday:
    Printf("Today Monday");
    Case Monday:
    Printf("Today Monday");
    }
    }

  • @groww9276
    @groww9276 5 ปีที่แล้ว +4

    Please promise that after C language you make videos on java or android.please.

  • @luckynarayani4604
    @luckynarayani4604 ปีที่แล้ว

    H.W. : at 17:53
    #include
    int main() {
    int choice;
    printf("ENTER YOUR CHOICE: ");
    scanf("%d",&choice);
    switch (choice)
    {
    case 1: printf("Your choice is good.");break;
    case 2: printf("Your choice is better.");break;
    case 3: printf("Your choice is best.");break;
    default: printf("INVALID CHOICE");
    }
    return 0;
    }

  • @srij_12
    @srij_12 3 ปีที่แล้ว +3

    # include
    // conversion of marks to grades .
    int main()
    {
    int marks;
    printf("enter your marks between 0 to 100
    ");
    scanf("%d" , &marks);
    switch(marks/10)
    {
    case 10 :
    case 9 :
    printf("your grade is A
    ");
    break;
    case 8 :
    printf("your grade is B
    ");
    break;
    case 7 :
    printf("your grade is C
    ");
    break;
    case 6 :
    printf("your grade is D
    ");
    break;
    default :
    printf("your grade is F");
    break;
    }
    return 0;
    }

  • @vishalsharma3095
    @vishalsharma3095 4 ปีที่แล้ว +39

    if,else and switch
    #include
    int main()
    {
    int age, le;
    printf("Enter your age to test drive
    ");
    scanf("%d",&age);
    if (age

    • @jyotiranjankunda2001
      @jyotiranjankunda2001 4 ปีที่แล้ว

      Bhai ye escape sequence
      ok ka mtlb kya hai jo tumne printf statement ke andar likha h shuruvat me

    • @shreyashkakde9315
      @shreyashkakde9315 4 ปีที่แล้ว +3

      @@jyotiranjankunda2001 bro vo
      ok nhi hai
      he hai bas inhone
      k bad whitespase nhi deye hai ko kam
      ka he kare ga

    • @idontknow8522
      @idontknow8522 4 ปีที่แล้ว +1

      @@jyotiranjankunda2001
      ke bad jobhi Likha hota Hain wo new line me Chala jata hain

    • @idontknow8522
      @idontknow8522 4 ปีที่แล้ว +1

      @@_RajatDhullCSB 🤔

    • @vishalsharma3095
      @vishalsharma3095 4 ปีที่แล้ว +2

      @@jyotiranjankunda2001/n ka mtlb new line hai
      ok

  • @theprogramedworld1168
    @theprogramedworld1168 3 ปีที่แล้ว +2

    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

  • @geethabhute4834
    @geethabhute4834 ปีที่แล้ว

    #include
    int main(int argc, char const *argv[])
    {
    int num;
    printf("Guess a Number between 1 -10
    ");
    printf("Enter your Number
    ");
    scanf("%d", &num);
    switch (num)
    {
    case 3:
    printf("The Number is 3
    ");
    printf("Congratulations you have guessed a right number!");
    break;
    case 5:
    printf("The Number is 5
    ");
    printf("Congratulations you have guessed a right number!");
    break;
    case 7:
    printf("The Number is 7
    ");
    printf("Congratulations you have guessed a right number!");
    break;
    default:
    printf("No you have entered a wrong number!
    ");
    break;

    }

    return 0;
    }
    Thank U for Teaching in this easy manner.

  • @mayankpanjwani6643
    @mayankpanjwani6643 4 ปีที่แล้ว +11

    I NEED A CHEAT SHEET OF
    C PROGRAMMING LANGUAGES.

  • @Codingwallah-i9r
    @Codingwallah-i9r ปีที่แล้ว +1

    #include
    int main(){
    int roll_no;
    printf("Enter Your roll no:");
    scanf(""%d",&roll_no);
    switch (roll_no){
    case 100:printf("me"); break;
    case 1000:printf("My friend"); break;
    case 10000:printf("My Girlfriend"); break;
    default:printf("Invalid roll no");}
    }

  • @sharyyyyy4
    @sharyyyyy4 ปีที่แล้ว

    #include
    int main() {
    int height;
    printf("enter your height: ");
    scanf("%d", &height);
    switch(height){
    case 5:
    printf("your height is 5");
    break;
    case 6:
    printf("your height is 6");
    break;
    case 7:
    printf("your height is 7");
    break;
    default:
    printf("error");
    }
    return 0; }

  • @kanavbatra443
    @kanavbatra443 2 ปีที่แล้ว +3

    // 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

    • @Lafhdajhalare
      @Lafhdajhalare 2 ปีที่แล้ว

      Bro I got error in my code can uh please help me😕

    • @kanavbatra443
      @kanavbatra443 2 ปีที่แล้ว

      @@Lafhdajhalare bro what is the error?

    • @kanavbatra443
      @kanavbatra443 2 ปีที่แล้ว

      have you tried my code?

  • @sahilsingh1753
    @sahilsingh1753 2 ปีที่แล้ว

    i did this #include
    int main(){
    int days;
    printf("Enter the day of position in week:-
    ");
    scanf("%d", &days);
    switch (days)
    {
    case 1:
    printf("Monday
    ");
    break;
    case 2:
    printf("Tuesday
    ");
    break;
    case 3:
    printf("Wednesday");
    break;
    case 4:
    printf("Thursday
    ");
    break;
    case 5:
    printf("Friday
    ");
    break;
    case 6:
    printf("Saturday
    ");
    break;
    case 7:
    printf("Sunday
    ");
    break;
    default:
    printf("Thier are 7 daya in week ");
    break;
    }
    return 0;
    }

  • @radhekrishna5248
    @radhekrishna5248 ปีที่แล้ว +1

    #include
    main()
    {
    int mango;
    printf("enter the color of mango");
    scanf("%d",&mango");
    switch(mango)
    {
    case 1:
    printf("the mango is orange");
    break;
    case 2:
    printf("the mango is red");
    break;
    default:
    printf("you are wrong");
    break;
    }
    return0;
    }

  • @rautsarthak8401
    @rautsarthak8401 ปีที่แล้ว +1

    #include
    int main()
    {
    int age;
    printf("what is your age
    ");
    scanf("%d",&age);
    switch(age){
    case 18:
    printf("the ans is sarthak
    ");
    break;
    case 45:
    printf("Its your father age
    ");
    break;
    case 38:
    printf("Its your mothers age
    ");
    break;
    default:
    printf("its is not your describe data
    ");

    }
    return 0;
    }

  • @food8814
    @food8814 4 ปีที่แล้ว +4

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

    • @mahmad48
      @mahmad48 4 ปีที่แล้ว +1

      statement terminator after printf statement and in last not 3th it should be 6th

  • @jayanspaliwal5907
    @jayanspaliwal5907 3 ปีที่แล้ว +8

    I think it's better to use break if we don't want the code to behave erratic

  • @c_56_rushikeshsunilpingale65
    @c_56_rushikeshsunilpingale65 2 ปีที่แล้ว +2

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

    }

    • @omkarsawant939
      @omkarsawant939 ปีที่แล้ว

      Bro muze activation extension nahi dikha raha hai kya karu

  • @pankajhazarika1148
    @pankajhazarika1148 3 ปีที่แล้ว +3

    void main()
    {
    int const X=0;
    switch(5/4/3){
    case X: printf("Clinton");
    break;
    case X+1:printf("Gandhi");
    break;
    case X+2:printf("Gates");
    break;
    default: printf("Brown");
    }
    }
    Select one:
    a.
    Clinton
    b.
    Gandhi
    c.
    Gates
    d.
    compiler Error
    Answer do

  • @sohamrajput783
    @sohamrajput783 2 ปีที่แล้ว +5

    #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();
    }

  • @NZM-o8i
    @NZM-o8i 3 หลายเดือนก่อน +1

    #include
    int main(){
    int speed;
    printf("Enter the speed of the car:");
    scanf("%d",&speed);
    switch(speed){
    case(30):
    printf("The speed of the car is 30km/h
    ");
    break;
    case(40):
    printf("The speed of the car is 40km/h
    ");
    break;
    case(50):
    printf("The speed of the car is 50km/h
    ");
    break;
    default:
    printf("The speed is neither 30,40,50km/h");
    break;
    return 0;
    }

  • @NaachMore
    @NaachMore ปีที่แล้ว

    #include
    int main() {
    int a;
    printf("Enter a=");
    scanf("%d",&a);

    switch(a) {
    case 1:
    printf("value is 10");
    break;
    case 2:
    printf("value is 20");
    break;
    default:
    printf("not found");
    break;
    }
    return 0;
    }

    • @NaachMore
      @NaachMore ปีที่แล้ว

      #include
      int main()
      {
      int days;
      printf ("enter the number of days=");
      scanf ("%d",&days);

      switch(days) {
      case 30:
      printf("
      it can be april, june, aug");
      break;

      case 31:
      printf("
      it can be jan, mar, july");
      break;

      case 29:
      printf("
      it can be feb");
      break;

      default:
      printf("
      it is something");
      }
      return 0;
      }

  • @Sarvesh-he7zx
    @Sarvesh-he7zx 4 หลายเดือนก่อน +1

    #include
    int main()
    {
    int value;
    printf("Enter the results of your medical tests
    ");
    scanf("%d", &value);
    switch(value)
    {
    case 80:
    printf("your health is good
    ");
    break;
    case 85:
    printf("your health is more better
    ");
    break;
    case 90:
    printf("your health is excellent
    ");
    break;
    default :
    printf("you have very high chances of sugar");
    }
    return 0;
    }

  • @gagansainibhajan5180
    @gagansainibhajan5180 9 หลายเดือนก่อน +1

    #include
    Int main()
    {
    Printf("enter your name
    ");
    Scanf("%d",&name);
    Switch age
    {
    Case gagan:
    Printf("your name is gagan
    ");
    break;
    Case akash:
    Printf("your name is akash
    ");
    Break;
    default:
    Printf("name is invalid");
    }
    return 0;
    run...!

  • @prathamkhatri3969
    @prathamkhatri3969 2 ปีที่แล้ว +1

    #include
    int main()
    {
    int a ;
    printf("what is your class
    ");
    scanf("%d" ,&a);
    switch (a)
    {
    case 1 :
    printf("your class is 1");
    break;
    default:
    printf("you are not in 1 class");
    }
    return 0;
    }

  • @simpiyashasvi5108
    @simpiyashasvi5108 3 ปีที่แล้ว +1

    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

  • @abhiswantchaudhary5548
    @abhiswantchaudhary5548 ปีที่แล้ว +4

    #include
    int main()
    {
    int a;
    printf("Enter the subject you like the most
    For mathematics press 1
    For Science press 2
    For English press 3
    ");
    scanf("%d", &a);
    switch(a)
    {
    case 1 :
    printf("Your favourite subject is Mathematics");
    break;
    case 2 :
    printf("Your favourite subject is Science");
    break;
    case 3 :
    printf("Your favourite subject is English");
    break;
    default:
    printf("Error!!
    You have entered wrong input");
    }
    return 0;
    }

  • @janhvinarayan1633
    @janhvinarayan1633 ปีที่แล้ว +1

    love your way of explaining, i wish all my college teachers were like u but never mind.

  • @vineetidesire
    @vineetidesire 3 ปีที่แล้ว

    आप पढ़ाते है न भईया - तो गर्दा उड़ा देते है आप।
    गजब 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻💖💖💖💖

  • @sjgaming2911
    @sjgaming2911 ปีที่แล้ว +1

    Simple code of Switch statement:-
    #include
    int main() {
    int age;
    printf("Enter Your Age: ");
    scanf("%d", &age);
    switch (age) {
    case 17: printf(" You are not eligible for Vote.");
    break;
    printf("
    ");
    case 18: printf("You are elidigble for vote.");break;
    printf("
    ") ;
    default : printf("Please Enter 17 and 18 only. ");}
    printf("
    ") ;
    return 0;
    }

  • @AdityaKate_
    @AdityaKate_ 7 หลายเดือนก่อน

    Simple Calculator Code using Switch case:
    #include
    int main()
    {
    int Number;
    printf("Enter the mode you want to select
    ");
    printf(" 1.Addition
    2.Subtraction
    3.Multiplication
    4.Division
    ");
    scanf("%d", &Number);
    switch(Number)
    {
    case 1:
    printf("we will be doing addition");
    break;
    case 2:
    printf("we will be doing subtraction");
    break;
    case 3:
    printf("we will be doing multiplication");
    break;
    case 4:
    printf("we will be doing division");
    break;
    default:
    printf("Error, re-enter the number");
    }
    return 0;
    }

  • @MuhammadHaris-xp1yd
    @MuhammadHaris-xp1yd 3 ปีที่แล้ว +1

    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 🌸

  • @krishnakantrajput9349
    @krishnakantrajput9349 ปีที่แล้ว

    #include
    int main() {
    int day;
    printf("ENTER DAY::");
    scanf("%d",&day);
    switch(day) {
    case 1:
    printf("Sunday
    2023");
    break;
    case 2:
    printf("Monday
    2023");
    break;
    case 3:
    printf("Tuesday
    2023");
    break;
    case 4:
    printf(" Wednesday
    2023");
    break;
    case 5:
    printf("Thursday
    2023");
    break;
    case 6:
    printf(" Friday
    2023");
    break;
    case 7:
    printf(" Saturday
    2023");
    break;
    default:
    printf("THIS IS NOT VALID DAY");
    }
    return 0;
    }
    thank you harry bhai

  • @pankajkumawat9778
    @pankajkumawat9778 2 ปีที่แล้ว +50

    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

    • @KESHRIXD
      @KESHRIXD 2 ปีที่แล้ว +2

      While(1) ku use kiya hai timne?

    • @parthborse8089
      @parthborse8089 2 ปีที่แล้ว

      Copied comment

    • @kamranhussen5364
      @kamranhussen5364 2 ปีที่แล้ว +1

      Mysirg se copy hey🙃

    • @ashutoshpradhan123
      @ashutoshpradhan123 2 ปีที่แล้ว +1

      Can we create a normal calculator using switch......???????

    • @KESHRIXD
      @KESHRIXD 2 ปีที่แล้ว

      @@ashutoshpradhan123 yes

  • @meghaghosh4877
    @meghaghosh4877 10 หลายเดือนก่อน +1

    // switch case for traffic lights
    #include
    int main() {
    // Write C code here
    char color;
    printf("enter the traffic signal color
    " ) ;
    scanf("%c", &color ) ;
    // type r for red, g for green, y for yellow
    switch (color)
    {
    case 'r':
    printf("you can walk") ;
    break;
    case 'g':
    printf("you should stop" );
    break;
    case 'y':
    printf("you should wait" ) ;
    break;
    }
    }

    • @rishabh.patel_143
      @rishabh.patel_143 10 หลายเดือนก่อน +1

      Bhai agar trafic light red hogi to, (You can walk) ke badle (You should stop) hona chahiye. Ok

  • @PR_Pavan
    @PR_Pavan ปีที่แล้ว +1

    #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.
    ❤❤

  • @healthwealth112
    @healthwealth112 3 หลายเดือนก่อน

    harry bhai main aj apki yeh video dakhi saray doubt clear ho gya allah apko lambi zindage da imran love from karachi pakistan

  • @OG_Yash10
    @OG_Yash10 11 หลายเดือนก่อน +1

    #include
    int main()
    {
    int age, marks;
    printf("Enter your age
    ");
    scanf("%d",&age);
    printf("Enter your marks
    ");
    scanf("%d",&marks);
    switch(age)
    {
    case 3 :
    printf("your age is 3
    ");
    break;
    case 20:
    printf("your age is 20
    ");
    switch(marks)
    {
    case 30:
    printf("your marks is 30
    ");
    break;
    default:
    printf("your marks is not 30
    ");
    }
    break;

    case 50:
    printf("your age is 50
    ");
    break;
    default:
    printf("your age is not 3,20 or 50");
    }
    return 0;
    }

  • @biswajitsamant6588
    @biswajitsamant6588 3 ปีที่แล้ว +1

    @CodeWithHarry bhai aapp ne to mera doubt hi pura clear kardiaa BHAI

  • @nbv-007
    @nbv-007 5 วันที่ผ่านมา

    include
    void main()
    {
    int age;
    printf("Enter your age: ");
    scanf("%d", &age);
    switch(age)
    {
    case 18:
    printf("Your age is 18");
    break;
    case 19:
    printf("Your age is 19");
    break;
    default:
    printf("Your age is not 18 or 19");
    break;
    }
    }

  • @Ahmed_king777
    @Ahmed_king777 2 ปีที่แล้ว

    Thanks Sir,
    #include
    int main(int argc, char const *argv[])
    {
    int age=12;
    printf("Enter your age
    ");
    scanf("%d", &age);
    printf("Your age is %d
    ", age);
    switch (age)
    {
    case 15:
    printf("The age is 15 is not allowed
    ");
    break;
    case 16:
    printf("The age is 16 is not allowed
    ");
    break;
    case 17:
    printf("The age is 17 is not allowed
    ");
    break;
    default:
    printf("You are eliigible
    ");
    break;
    }
    return 0;
    }

  • @rupeshvlogs2464
    @rupeshvlogs2464 5 หลายเดือนก่อน

    #include
    int main() {
    int age;
    printf ("enter your age
    ");
    scanf("%d",&age);
    switch (age){
    case 2:
    printf ("this is age 20
    ");
    break ;
    case 3:
    printf ("this is age 45
    ");
    break;
    default:
    printf ("age is not 20 and 45
    ");
    }
    return 0;
    }

  • @karthikeyac5662
    @karthikeyac5662 2 ปีที่แล้ว +1

    Just a simple program Harry Bhai..
    #include
    int main()
    {
    int marks;
    printf("Enter your marks :");
    scanf("%d", &marks);
    switch (marks)
    {
    case 100:
    printf("You secured 1st rank in the class");

    break;
    case 99:
    printf("You secured 2nd rank in the class");
    break;
    case 98:
    printf("You secured 3rd rank in the class");
    break;

    default:
    printf("You did not secure the top 3 ranks in the class");
    break;
    }
    }

  • @RanaharshSingh-tk7gd
    @RanaharshSingh-tk7gd 3 หลายเดือนก่อน

    #include
    Int main ( ) {
    Int day;
    Scanf("%d", &day) ;
    Switch (day) {
    Case 1:
    Printf("monday
    ") ;
    Break;
    Case 2:
    Printf("tuesday
    ") ;
    Case 3:
    Printf("Wednesday
    ") ;
    Case 4:
    Printf("Thursday
    ") ;
    Default:
    Printf("default case
    "l) ;
    }
    Return 0;
    }

  • @alexabhishek7632
    @alexabhishek7632 ปีที่แล้ว +1

    #include
    int main() {
    int jersey_no;
    printf("enter any jersey no.
    ");
    scanf("%d",& jersey_no);
    switch(jersey_no)
    {
    case 7:
    printf("ms dhoni");
    break;
    case 8:
    printf("r jadeja");
    break;
    case 10:
    printf("god sachin");
    break;
    case 17:
    printf("ab devliler");
    break;
    case 18:
    printf("virat");
    break;
    case 45:
    printf("rohit");
    break;
    case 99:
    printf("ashwin anna");
    break;
    default:
    printf("don't know him");
    }
    return 0;
    }

  • @Darshan_Patil_01
    @Darshan_Patil_01 ปีที่แล้ว +1

    int code;
    scanf("%d", &code) ;
    switch(code) {
    case 50:
    printf("code is 50") ;
    break;
    case 100:
    printf("code is 100) ;
    break;
    Case 30:
    printf ("cod eis 30");
    break;
    default;
    printf ("Nothing matched") ;
    }

  • @hestroif
    @hestroif 2 ปีที่แล้ว +1

    #include
    int main(int argc, char const *argv[])
    {
    int subject;
    printf("type 1 for Math. 2 for Physics. 3 for Chemistry. 0 for all Math, Physics and Chemistry
    ");
    printf("Enter the subject name : ");
    scanf("%d", &subject);
    switch (subject)
    {
    case 0:
    printf("You've selected all subjects.");

    break;

    case 1:
    printf("You've selected Math.");
    break;
    case 2:
    printf("You've selected Physics.");
    break;
    case 3:
    printf("You've selected Chemistry.");
    break;
    default:
    printf("You didn't entered wrong number.");
    break;
    }
    return 0;
    }