Video není dostupné.
Omlouváme se.

C_32 C Program to make simple calculator using Switch Case | C Language Tutorials

Sdílet
Vložit
  • čas přidán 12. 01. 2021
  • We will write a C Program to make Calculator using Switch case.
    Best C Programming Tutorials : • Programming in C
    *******************************************
    Connect & Contact Me:
    My Second Channel Link: bit.ly/354n7C7
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/...
    Instagram: / jayantikhatrilamba
    Twitter: / khatrijenny
    *********************************************
    More Playlists:
    C++ Programming Tutorials: • Lec 1: How to Install ...
    Placement Series: • Placements Series
    Data Structures and Algorithms: https: • Data Structures and Al...
    Design and Analysis of Algorithms(DAA): • Design and Analysis of...
    Python Full Course: • Python - Basic to Advance
    Printing Pattern in C: • Printing Pattern Progr...
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    #cprogramming #jennyslectures #programming #clanguage

Komentáře • 249

  • @Versa-VibesHub
    @Versa-VibesHub Před 3 lety +89

    I'm a software developer working since 3 year in industry but still I watch your all videos because of your impressive teaching. It make me feel that I'm still a student... ❤️

    • @abreducationnepal
      @abreducationnepal Před 2 lety

      Kaun se company me kaam karte hi

    • @ritaahmed989
      @ritaahmed989 Před rokem +1

      yeah she is really good

    • @simon-gh1pt
      @simon-gh1pt Před rokem +2

      #include
      int main()
      {
      float a,b;
      char x;
      printf("hello user
      ");
      printf("Enter two numbers:
      ");
      scanf("%f %f",&a,&b);
      printf("Enter + or - or / or *:
      ");
      scanf("%c", &x);

      switch (x)
      {
      case '+':
      printf("The value of addition is %f
      ", a + b);
      break;
      case '-':
      printf("The value of substraction is %f
      ", a - b);
      break;
      case '*':
      printf("The value of multiplication is %f
      ", a * b);
      break;
      case '/':
      printf("The value of division is %f
      ", a / b);
      break;
      default:printf("invalid input
      ");
      }
      printf("Thank You");
      return 0;
      }
      /*I am facing a problem while running this.*/
      The output is like:
      hello user
      Enter two numbers:
      5 7
      Enter + or - or / or *:
      invalid input
      Thank You
      The problem is when I press the Enter key after entering first inputs(numbers),the program ends and print as above and doesn't take the input for the operator. What's the problem? Can anyone please answer

    • @saamimahmud5355
      @saamimahmud5355 Před rokem

      @@simon-gh1pttry using int a,b; instead of float a,b;

    • @dreypraydev
      @dreypraydev Před 11 měsíci

      @@simon-gh1pt You have to either write scanf(" %c", &x); (WITH THE SPACE BEFORE THAT %c -> because it will jump over the
      used) or just simply don't write those
      at the beginning since those are not helping at all in the very first start.

  • @heartbreakkid8966
    @heartbreakkid8966 Před 3 lety +24

    Please start C# course from scratch to expert level, by the way excellent teaching skills.. I said it before and I must say again.. such a beautiful and intelligent brain 🧠 is hidden in a beautiful and innocent soul, respect from Pakistan, stay always blessed..

    • @sujathanarayana2286
      @sujathanarayana2286 Před 3 lety +4

      c# programming language is best for app development and it is easy too but c++ and java far better and c++ best language in the world it as so benefits than other languages but it is so hard you can also do robotics using c++ so learn c++ or java instead .

    • @jagrutidash4542
      @jagrutidash4542 Před rokem

      @@sujathanarayana2286 nowadays c++ is not much in use.. python has more demand than any other language cuz it gives a lot advantages to developers

  • @harshvardhantandon8278
    @harshvardhantandon8278 Před 2 lety +55

    For flipping the values a and b, we will write the scanf function like this scanf("%d %d", &b,&a);

    • @devSackey
      @devSackey Před rokem +1

      exactly

    • @studyadda-25
      @studyadda-25 Před 11 měsíci +2

      No bro you will need to declare another variable c and and some declerative statement to flip the value

    • @harshvardhantandon8278
      @harshvardhantandon8278 Před 11 měsíci

      ​@@studyadda-25 yes bro you are right but the one I have written above is a cheat method 😂 just for fun😅

  • @cricket_addicted_guys
    @cricket_addicted_guys Před 2 lety +16

    In this pandemic situation... Your videos are very helpful to me to understand c programming.. Thank you mam❣️

  • @harshvardhantandon8278
    @harshvardhantandon8278 Před 2 lety +14

    If we will not write break then it will evaluate addition as well as subtraction because the next break statement is after subtraction.

  • @AnandKumar-hj6zo
    @AnandKumar-hj6zo Před 3 lety +16

    Thank you mam for regular uploading your video
    You are the real avtar of Saraswati maa !!

  • @omkarkumbharkar906
    @omkarkumbharkar906 Před 3 lety +10

    I am understand this program 👍🙏 mam tysm mam

  • @nadid5347
    @nadid5347 Před rokem +1

    I am so happy I discovered your courses, you are the best teacher ever

  • @18fatima15
    @18fatima15 Před 5 měsíci +2

    13:15 the next case that is case ' - ' will also be executed. And the break statement of case ' - ' will terminate the switch

  • @haiderabbas8066
    @haiderabbas8066 Před 2 lety +6

    ma'am is there is chance of data loss if do 5/2? output will be 2 instead of 2.5
    as you told us in pervious video we can't use float data type in switch case, plz me alternative of float which can be use here

  • @geethikad3274
    @geethikad3274 Před 2 lety +12

    If we remove break statement in case'+', the control will go to case'-' and give its value along with case'+'
    eg: a = 2 b=3
    case'+' = 5
    case'-' = -1

    • @Amit_iPhone_shorts
      @Amit_iPhone_shorts Před 2 lety +3

      It gives the value of all the operator until u come to the default part.

    • @nagendrachariramadugu5342
      @nagendrachariramadugu5342 Před 2 lety +3

      @@Amit_iPhone_shorts
      No dear,the keyword "break" ultimately stops the controller as soon as it prints the values of substraction.

  • @teluguchandramouli4990
    @teluguchandramouli4990 Před rokem +2

    Excuse me..
    Mam
    There is no error in program but I am taking a, b values from user but in output it is not shows

  • @abdulrahimjalloh363
    @abdulrahimjalloh363 Před rokem +4

    To enter 3 for a and 2 for b:
    scanf("%d %d", &a,&b);
    or simply you can type 3 as the first value and 2 as the second value
    if you fail to write break at case '+'
    the statement will be printed, but another case too will be printed if it matches the expression, and then default will be printed

  • @souvikroy3584
    @souvikroy3584 Před 4 měsíci +1

    Thank you mam, now this is clear to me

  • @harinidumpa4570
    @harinidumpa4570 Před 3 lety +2

    Mam ur like a goddess to me. Thank u for explaining c program very clearly.

  • @akhilareddy3489
    @akhilareddy3489 Před 3 lety +3

    Thanks mam...For giving easy expalination and without any confusion..

  • @bolaganisrilakshmi5249
    @bolaganisrilakshmi5249 Před 7 měsíci +1

    without break is gives a sum is a+b and printf statemnts and also nest statement will be executed and next in line are given break stop the loop

  • @bhimanagoudagoudappagoudra2396
    @bhimanagoudagoudappagoudra2396 Před 4 měsíci +1

    not writing default after case complete it will not give error but it will execute next case also without checking condition it execute untill breaks coming

  • @isaac-victorshonowo1838
    @isaac-victorshonowo1838 Před 10 měsíci +1

    Watched and Understood ❤

  • @Bharat286
    @Bharat286 Před 3 lety +4

    Greatly explained....
    Plzz.. do practical part on PC...

  • @user-lh8on3us8u
    @user-lh8on3us8u Před 3 lety +4

    Ma'am Thank You So Much for the Videos
    I recently subscribed to you're channel and I wanted to know more about you're professional background but couldn't find any such info available

  • @a_yucodes9625
    @a_yucodes9625 Před 3 lety +6

    Please discuss your lectures on vs code editor 👍

  • @poornima7805
    @poornima7805 Před 3 měsíci +6

    Which is your native language

  • @BikashDas-un9ec
    @BikashDas-un9ec Před 2 lety +5

    1st qn: scanf("%d %d",&b,&a);
    2nd qn:if we not use "break" then it will execute the undesirable part also and will not break the sequence

  • @richieabbugamingff498
    @richieabbugamingff498 Před rokem +2

    Without break , the program continues to the next labeled statement, executing the statements until a break or the end of the statement is reached.

  • @vedantvadadoriya2335
    @vedantvadadoriya2335 Před rokem +1

    Mam is so pretty 😊

  • @sanjurajsalupala4918
    @sanjurajsalupala4918 Před rokem +1

    We can give logic without declaring sum sub replacing (a+b,a-b)

  • @saijalaneela7162
    @saijalaneela7162 Před rokem

    I love your way of teaching madam

  • @abhishek5212
    @abhishek5212 Před 8 měsíci +1

    thank you so much

  • @sufi065
    @sufi065 Před 2 lety

    Mam your way of explanig is next leval god bless you mam💕🦋

  • @gskerbecs9513
    @gskerbecs9513 Před 7 měsíci +1

    Thanks alot mam

  • @sia5310
    @sia5310 Před 3 lety +1

    Good morning mam please use whiteboard for making understand as it gives clear visualisation of dry run .as After watching I use IDE to run program and it become easy after only having clear understand from whiteboard you taught.
    And please do upload for function . Thankyou

  • @sigmatronX
    @sigmatronX Před rokem +1

    Please use IDE

  • @Anoopmaurya7711
    @Anoopmaurya7711 Před 3 lety

    Maim voice and teaching techniques is very good

  • @unlockingmind12
    @unlockingmind12 Před rokem +1

    Tq mam,

  • @schoollife1284
    @schoollife1284 Před 3 lety +1

    U r good teacher

  • @ravikiran_mothukuri
    @ravikiran_mothukuri Před 2 lety +1

    if we use + operator which is given by user then if we forget the break statement in last it will continue the next case which is (-) subtraction then it will stop due to that statement has break:

  • @rajjoshi3215
    @rajjoshi3215 Před 3 lety +3

    maam plz give light on how to check even odd by switch

  • @sachinmishra7674
    @sachinmishra7674 Před 3 lety +2

    Creation of Binomial queue?
    Love from NEPAL🇳🇵🇳🇵

  • @abdulkarimshaikh9648
    @abdulkarimshaikh9648 Před 3 lety +1

    hello maam, it is good way to teach and understand the programming using white board max,
    use just ide to show, execute, and run,
    using white board to teach is best for memorization and understanding,
    because we should practice after watch your videos
    thankyou

  • @abhileswar
    @abhileswar Před rokem +1

    how to write code to find uppercase or lowercase using switch case

  • @sumainakyasar8857
    @sumainakyasar8857 Před 2 lety +2

    How to do division if a

  • @ashaks9500
    @ashaks9500 Před 2 lety +1

    Thank u mam for your amazing reaching 🤗

  • @anurag_ad_01
    @anurag_ad_01 Před 3 lety +2

    Thanku for everything mam

  • @tps8470
    @tps8470 Před 2 lety +1

    Thanks a Lot Mam

  • @mokshatyaveeramalla19
    @mokshatyaveeramalla19 Před 2 lety +1

    Mam,use ide for understanding examples and use white board for concept

  • @rakeshtumbal
    @rakeshtumbal Před 3 lety +2

    Make videos on java programming please mam..

  • @Bikelover369-hit
    @Bikelover369-hit Před 3 lety +3

    Mam ur looking very cute and super 😍

  • @tsdonalds1668
    @tsdonalds1668 Před rokem

    Another banger baby clam down ,calm down

  • @brpubggameryt8282
    @brpubggameryt8282 Před 3 lety +1

    I am already have made the program using switch case

  • @continnum_radhe-radhe
    @continnum_radhe-radhe Před 2 lety +1

    Thank you mam 🔥🔥🔥

  • @johnsumith2107
    @johnsumith2107 Před 2 lety +2

    One doubt mam if we first scan numbers it is giving invalid output but if we first scan operators it is giving correct output can u plz explain mam

  • @hariparuchuru3858
    @hariparuchuru3858 Před 2 lety

    if we don't write break it will not get out of the loop after getting desired answer and also prints the next case values.

  • @aniketkumar3126
    @aniketkumar3126 Před 3 lety

    Mam hat's off to ur effort

  • @food8814
    @food8814 Před 3 lety +1

    we will & b,&a to store 3 in a 2 in b

  • @sagarghate2
    @sagarghate2 Před rokem +8

    12:05 swapping a two numbers
    1) using third variable
    Temp=a;
    a=b;
    b=Temp;
    2) without using third variable
    a=a+b;
    b=a-b;
    a=a-b;
    3) using bitwise xor
    temp=a^b;
    a=temp^a;
    b=temp^b;
    @jenny's lecture CS IT

  • @alpesh_parmar6488
    @alpesh_parmar6488 Před 3 lety

    Thankyou knowledges😊

  • @himanshu_9625
    @himanshu_9625 Před rokem

    if will not apply break after + then we will get sub also and if we eliminate break then we will get all result on same time i.e sum,subs.mul,div

  • @chillzzzstudio6309
    @chillzzzstudio6309 Před 3 lety

    It is helpful thank you

  • @venkataramsai3226
    @venkataramsai3226 Před 3 lety +1

    Nice ❤️❤️❤️❤️👍👍👍👍👍👍

  • @salahzain515
    @salahzain515 Před 3 měsíci +1

    void main{)
    int a,b,temp;
    char operator;
    printf("Enter a operator:");
    scanf("%c",&operator);
    printf("Enter 2 numbers");
    scanf("%d%d",&a,&b);
    temp=a;
    a=b;
    b=temp;
    switch(operator)
    {
    }

  • @akash.553
    @akash.553 Před 3 lety +2

    Is it necessary to print operator first in the above calculator program.

    • @chithraboominathan9652
      @chithraboominathan9652 Před 2 lety

      Yeah..then only we will get output

    • @MrAlpha-gn7qg
      @MrAlpha-gn7qg Před 2 lety

      @@chithraboominathan9652 But why?

    • @chithraboominathan9652
      @chithraboominathan9652 Před 2 lety

      @@MrAlpha-gn7qg Because, in the above program..switch expression we take is an operator.. when we enter an operator..then only the control will go inside the switch case and the corresponding task would be executed.

    • @MrAlpha-gn7qg
      @MrAlpha-gn7qg Před 2 lety

      @@chithraboominathan9652 I am asking why we can't printf operands before operator?? Bcz if we did, the program is not working?... Is it necessary to printf operator first???

  • @estiaktanvir7688
    @estiaktanvir7688 Před 2 lety +3

    Mam respect from Bangladesh. Please continue your great work, you have a great heart.
    #include
    #include
    int main()
    {
    float num1,num2,result;char op;
    scanf("%f%c%f",&num1,&op,&num2);
    switch(op)
    {
    case '+':result=num1+num2;break;
    case '-':result=num1-num2;break;
    case '*':result=num1*num2;break;
    case '/':result=num1/num2;break;
    }
    printf("Result = %.4f",result);
    getch();
    }

  • @atharvabrahmankar5129
    @atharvabrahmankar5129 Před 3 lety +1

    Can you make an vidio regarding AMCAT test..plz.😊

  • @gyaneshkumartiwari6570

    Nice lecture mam

  • @tinula
    @tinula Před 3 lety +1

    Dear madam, why its not accepting scanf() char variable choice, when we enter this order. but if we enter the symbol first and entering number following is allowed, but if we entered the a = 10 and b = 20 those should store separate memory location and could be called by case statements in switch function. ? please help. - Thanks
    printf("Enter 1 integer numbers
    "); scanf("%d", &a);
    printf("Enter 2 integer numbers
    "); scanf("%d", &b);
    printf("a. Addition
    b. Subtraction
    c. Multiplication
    d. Division
    ");
    printf("Enter your choice :");
    scanf("%c",&choice);
    // from here onward
    switch(choice)
    case: 'a'
    // addition will perform, and other operations ..... etc
    printf*
    %d + %d = %d", a,b,a+b);

    • @chigsthanky
      @chigsthanky Před rokem

      I'm facing the same issue. If we enter the numbers first and then enter the operator, it is not accepting the input of characters. Why? idk

    • @ritikamundhra4
      @ritikamundhra4 Před rokem +1

      Use ch instead of c

  • @priyae7671
    @priyae7671 Před rokem

    Super mam🤟🤟

  • @rit03a.navaneedhan80
    @rit03a.navaneedhan80 Před 3 lety +2

    // Online C compiler to run C program online
    #include
    int main() {
    // Write C code here
    int a,b,choice;
    printf("ente the two value");
    scanf ("%d %d",&a,&b);
    printf ("
    enter 1 for addition" );
    printf ("
    enter 2 for subtrct");
    printf ("
    enter 3 for multiple");
    printf ("
    enter 4 for divison");
    printf ("
    enter 5 for modulus ");
    printf("
    enter choice");
    scanf("%d",&choice);
    switch (choice)
    {
    case 1:
    printf (" the add is =%d",a+b);
    break;
    case 2:
    printf (" the sub is =%d",a-b);
    break;
    case 3:
    printf (" the mul is =%d",a*b);
    break;
    case 4:
    printf (" the division is =%d",a/b);
    break;
    case 5:
    printf (" the modules is =%d",a%b);
    break;
    default :
    printf ("out");
    }
    return 0;
    }
    Mam another method of calculator using switch statement

  • @harshvardhantandon8278
    @harshvardhantandon8278 Před 2 lety +1

    Mam, please use both IDE and whiteboard.

  • @madhavsehra9193
    @madhavsehra9193 Před 3 lety +1

    Wish i had you as my teacher in my university.

  • @musheerabbas4249
    @musheerabbas4249 Před 3 lety

    Amazing ma'am

  • @shubhthearcher4088
    @shubhthearcher4088 Před 3 lety +2

    I think we have to assign 0 to all sum,div,sub,multi=0 othervice it gives an ERROR

    • @jagrutidash4542
      @jagrutidash4542 Před rokem

      It will give error in loop like when u write
      sum += i cuz computer doesn't know what initial value is there in sum, but in case of addition it's ok if we don't assign 0 to sum

  • @ritip9570
    @ritip9570 Před 3 lety +1

    Mam please make videos on 4th module Arithmetic of computer organization sub 18CS34

  • @ningaiahningaiah3734
    @ningaiahningaiah3734 Před rokem

    Both addition and subtraction will be performed

  • @aashrithaganga7492
    @aashrithaganga7492 Před 2 lety

    If break stmt is removed stmt of case one and case two both will be displayed

  • @rangaswamy6667
    @rangaswamy6667 Před 3 lety

    Switch to 'turbo c' mam.we will understand that programs very well mam 😁

  • @durgfestivalvibes
    @durgfestivalvibes Před 3 lety

    Thankyou maam.

  • @aliimranmemon939
    @aliimranmemon939 Před rokem

    Mam please work on Visual studio or on Dev

  • @hero3662
    @hero3662 Před rokem

    Mam I have a small doubt
    #include
    void main()
    {
    int movie = 1;
    switch (movie

  • @sony5848
    @sony5848 Před rokem

    If i am entering + and not writing break the sum will print 3 times(2nd answer)

  • @premraj1456
    @premraj1456 Před 3 lety

    Thanks mam

  • @MuthumeenaB
    @MuthumeenaB Před měsícem

    First we enter a operator and we should enter a value that is the only way ??
    First I enter a value the i will enter a operator it wouldn't run

  • @vedantvadadoriya2335
    @vedantvadadoriya2335 Před rokem +10

    If i were your age ,i would marry you😊

  • @anshkaur
    @anshkaur Před rokem

    Yes maim pls use....screen..

  • @schoollife1284
    @schoollife1284 Před 3 lety +1

    It's my first comment

  • @bloggingfreek
    @bloggingfreek Před rokem

    Ma'am Hindi ma video hota to aur jaya acha sa samaj ma aata
    Thanku ma'am 🙂

  • @charliekunjip1990
    @charliekunjip1990 Před 2 lety

    Can you do a video for object oriented development please

  • @gogikarsunitha3853
    @gogikarsunitha3853 Před 3 lety

    White board is good mam

  • @rajkumarsangeliadudhwa2147

    Good

  • @kidstv2762
    @kidstv2762 Před 3 lety

    Make vidio on nested switch..

  • @chiraggaba_030
    @chiraggaba_030 Před 2 lety

    Plz Mam make A video Of Nested Switch Program

  • @aniketkumar3126
    @aniketkumar3126 Před 3 lety

    Viewed in 17 sec

  • @christianfiregospel5758
    @christianfiregospel5758 Před 3 lety +1

    Ok mam

  • @Mr.DarkTechy
    @Mr.DarkTechy Před 3 lety

    miss you not teached nested switch case.

  • @laxminarayanan6687
    @laxminarayanan6687 Před 3 lety +1

    please start core java mam

  • @jackdaniel2228
    @jackdaniel2228 Před rokem

    +,-,*.. these are arithematic operator know mam we can write as char opperator?Pls reply

  • @namburinandakishore1289

    mam is there any limit to c programming or a last concept in c

  • @kshitijkumar319
    @kshitijkumar319 Před rokem

    how can i write a program in c language to make a calculator like smartphone calculator.
    eg:- if we write 9+8=17-5=15/3=5
    like this i want to make calculator maam

  • @bhartigulati7248
    @bhartigulati7248 Před 2 lety +1

    mam please use ide

  • @kusumurumounika1397
    @kusumurumounika1397 Před rokem

    Why do we use getch() at the end mam