Modify Operators | C Technical Interview Questions and Answers | Mr. Srinivas

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • Modify Operators | C Technical Interview Questions and Answers | Mr. Srinivas
    ** For Online Training Registration: goo.gl/r6kJbB ► Call: +91-8179191999
    Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.
    💡 Visit Our Websites
    For Classroom Training:nareshit.in/c-...
    For Online Training: nareshit.com/c...
    #Clanguage #Programming #Tutorials #Course #Training
    --------------------------
    💡 About NareshIT:
    "Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations
    --------------------------
    💡 Our Online Training Features:
    🎈 Training with Real-Time Experts
    🎈 Industry Specific Scenario’s
    🎈 Flexible Timings
    🎈 Soft Copy of Material
    🎈 Share Videos of each and every session.
    --------------------------
    💡 Please write back to us at
    📧 us.training@nareshit.com/ 📧 online@nareshit.com or Call us at the USA: ☎+1404-232-9879 or India: ☎ +918179191999
    --------------------------
    💡 Check The Below Links
    ► For Course Reg: goo.gl/r6kJbB
    ► Subscribe to Our Channel: goo.gl/q9ozyG
    ► Circle us on G+: plus.google.co...
    ► Like us on Facebook: / nareshit
    ► Follow us on Twitter: / nareshitek
    ► Follow us on Linkedin: goo.gl/CRBZ5F
    ► Follow us on Instagram: goo.gl/3UXYK3

Komentáře • 126

  • @NareshIT
    @NareshIT  Před 5 lety +8

    Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: @t

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

      Sir answer is 9 and 19

    • @SunitaSharma-sb7eg
      @SunitaSharma-sb7eg Před 2 lety

      sir output on "vs code" and "code block" is 19 and 9 but "blue & black" on output is 18 and 8 . pls explain.....

    • @swapnilwagh3274
      @swapnilwagh3274 Před rokem

      wrong answer

  • @mohammadsujon124
    @mohammadsujon124 Před 4 lety +29

    Sir, in first expression a = 4 and b = 9. And second expression a = 19 and b = 9.

  • @prajwalkm9767
    @prajwalkm9767 Před 5 lety +50

    Sir you have gone wrong here. Answer for a = 19 and b = 9.

    • @rahuljathar9429
      @rahuljathar9429 Před 5 lety +12

      Turbo c compiler ans is : 18,8
      gcc compiler ans is : 19,9
      output is depend on your compiler (software)

    • @VikramS411
      @VikramS411 Před 5 lety +2

      right bro..

    • @mbeddedwindrobotics1726
      @mbeddedwindrobotics1726 Před 4 lety +2

      @@rahuljathar9429 ggc compiler dusra method use karta hai solve k lie? or yadi hai to bata do bhae kaise , mujhe samjh nae a rhi problem.

    • @jeneeshrobert2113
      @jeneeshrobert2113 Před 4 lety +2

      In turbo c++ 18 and 8

    • @clashingdrash1772
      @clashingdrash1772 Před 2 lety

      check with changing a-- by a no change occur

  • @rahuljathar9429
    @rahuljathar9429 Před 5 lety +8

    Turbo c compiler ans is : 18,8
    gcc compiler ans is : 19,9
    output is depend on your compiler (software)

    • @Kumar12125
      @Kumar12125 Před 4 lety

      Thank u bro, you clarified my doubt

  • @uddiptamondal9509
    @uddiptamondal9509 Před 4 lety +10

    Sir, I think there is a problem in calculation. When I calculated myself I got 19, 9. And after compiling I got the same as output from my machine. Would you please explain?

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

      yes, the same case happening at my side too.

    • @duggirambabu7792
      @duggirambabu7792 Před 2 lety

      Which compiler do you use?

    • @duggirambabu7792
      @duggirambabu7792 Před 2 lety

      @@atom7004
      Which compiler do you use?

    • @diogo2381
      @diogo2381 Před rokem

      Same here. I am using Code Blocks 20.03. But there are two warning messages :
      warning: operation on 'a' may be undefined [-Wsequence-point]|
      warning: operation on 'b' may be undefined [-Wsequence-point]|

  • @singamhariharan7459
    @singamhariharan7459 Před 10 měsíci +3

    int a=4, b=5;
    b = a++ + a--;
    a = ++b + b--;
    b = 4(now a=5 bcoz post inc)
    + 5( now a=4 bcoz post dec)
    So now b = 4+5=9 and now b value is 9 not 5
    a = 10(now b=10 bcoz pre inc)
    + 10(now b =9 bcoz post dec)
    So last updated value of b = 9
    And a = 10 + 10 = 20

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

    Crystal clear concept 🙏

  • @itsheaven5701
    @itsheaven5701 Před 6 lety

    That's the only place where I learnt a lot.... Tysm sir

  • @utkarshparekh7675
    @utkarshparekh7675 Před 4 lety +9

    Sir,as different compilers uses different method for solving this equation.so we student are confusing right now because our answer is not matching with your answer...yet you are right in solving this..but then also we are not getting so make a video to tell us difference of compiler to compiler...and which one is valid method to solve this equation.....plz reply sir.....

    • @AmanGupta-ph5sd
      @AmanGupta-ph5sd Před 4 lety

      In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend
      you to go through this youtube channel they have modern concept and easy way for understanding whole concept czcams.com/video/yRt-zYFJIvE/video.html

  • @harsh.m2897
    @harsh.m2897 Před rokem

    sir your answer is wrong :
    #include
    int main(void) {
    int a=4,b=5;
    b = a++ + a--;
    a= ++b+b--;
    printf("%d %d
    ",a,b);
    }
    this is giving me a = 20,b = 9

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

    i=4;
    j= ++i*i++;
    i calculated by your method j=25 but compiler giving j=30.
    help!!!!

  • @chandangiri777
    @chandangiri777 Před 5 lety

    Thanks sir you are fabolous fantastic stunning

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

    I compiled it also in Dev C Apllication..
    Output is. " 19 9".
    Guys make sure it

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

    Wrong,final value should be a=19 & b=9

  • @goutamdam8546
    @goutamdam8546 Před 2 lety

    Sir please discuss more equation with the combination of both increment and decrement operator on the same line of equation

  • @sujithgoud3535
    @sujithgoud3535 Před 4 lety +1

    Thank u 🙏 sir..!?

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

    a value is 19, b is 9

  • @manasatadigadapa4952
    @manasatadigadapa4952 Před 3 lety

    Superb sir 🙏🙏

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

    Hi op comes 19 9 please upload again

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

    Sir its wrong actually ans is a=19,b=9

  • @ganapakaakash415
    @ganapakaakash415 Před 4 lety +1

    It depends on compiler

  • @murgan4307
    @murgan4307 Před rokem +1

    hello sir from my prespective i think sir this is the wrong explanation first increment and decrement operation then addition I think this make sence
    Turbo c compiler ans is : 18,8
    gcc compiler ans is : 19,9
    output is depend on your compiler (software)

  • @duggirambabu7792
    @duggirambabu7792 Před 2 lety

    According to Turbo C++ Version 3.0,
    Output: a = 18, b = 8

  • @tapanjeetroy8266
    @tapanjeetroy8266 Před 6 lety

    thanks a lot sir...

  • @praveennaik3679
    @praveennaik3679 Před 4 lety

    main()
    {
    int z, x=5, y=-10, a=4, b=2;
    z=x++ - --y * --b / a;
    printf("%d ",z);
    }
    Output will be 7, how?

  • @anjanamanoj9186
    @anjanamanoj9186 Před 5 lety

    Thankyou sir

  • @nagendramishra100
    @nagendramishra100 Před 6 lety +8

    this method is wrong for solving expression

  • @Adityaarockss
    @Adityaarockss Před 7 lety

    Thank you

  • @sujathasivakumar6422
    @sujathasivakumar6422 Před 5 lety

    super sir.

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

    Output is 19,9 , i will give better explanation then you

  • @Gameplay-pq6hk
    @Gameplay-pq6hk Před 7 lety +2

    Sir please verify , Is this right ?
    I wrote the same code and got O/P 20 and 9

  • @gnanaswty
    @gnanaswty Před 5 lety

    I got result as same result of you nice one tq

  • @devashishchoubey1965
    @devashishchoubey1965 Před 5 lety

    thnx .

  • @Reddy7877
    @Reddy7877 Před rokem

    Hi sir,
    Can you please Execute and let me know the answer

  • @technicalsam6633
    @technicalsam6633 Před 5 lety +3

    i got the answer 19,9

  • @amilaliwaris
    @amilaliwaris Před 3 lety

    Sir answer is 9 and 19

  • @jagginadivya3680
    @jagginadivya3680 Před 5 lety +2

    answer is 19 and 9 sir u went wrong

    • @rahuljathar9429
      @rahuljathar9429 Před 5 lety

      Turbo c compiler ans is : 18,8
      gcc compiler ans is : 19,9
      output is depend on your compiler (software)

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

    Hi Sir. Can you explain how it will print 5 here.
    V1=2, V2;
    V2=V1++ + V1++;
    printf("%d", v2) ;

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

      1. step) left v1++ = 2, v1 = 3
      2. step) right v1++ = 3, v1 = 4
      3. step) v2 = v1++ + v1++ = 2 + 3 = 5, v1 = 4

    • @rutukeshkashid5058
      @rutukeshkashid5058 Před rokem

      V1 is 2 here . So use it in equation the change it into 3...So, 2+3=5 is the value of V2 and value of V1 is 4

  • @rising_legends1771
    @rising_legends1771 Před rokem +1

    sir ,answer is wrong!

  • @vaibhavambekar7427
    @vaibhavambekar7427 Před 5 lety

    Ans is wrong ,it is 19,9 in both 32 bit and 64 bit compiler

  • @shifasultana9926
    @shifasultana9926 Před 7 lety

    #include
    int main()
    {
    int i = 1;
    printf("%d %d %d
    ", i++, i++, i);
    return 0;
    }
    sir wat is d output of this

  • @narasareddymule1728
    @narasareddymule1728 Před 4 lety +2

    Video visual clarity ledu ra

  • @shaik3172
    @shaik3172 Před 2 lety

    dammn my compiler is showing a =19 and b = 9 ; am i wrong dude?

  • @Hasini_ananthula
    @Hasini_ananthula Před 7 měsíci

    Anna b=9

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

    Sir u have done wrong please cross check once

  • @rajpra7993
    @rajpra7993 Před 4 lety +1

    Solving with right method, we get 20,9 answer

    • @mohammadsujon124
      @mohammadsujon124 Před 4 lety +2

      Brother, according to mingw and gcc compiler a = 19 b = 9.

    • @jishandas6559
      @jishandas6559 Před 3 lety

      Solving with right method, the answer is 19,9

    • @singamhariharan7459
      @singamhariharan7459 Před 10 měsíci

      No follow the concept of increment operators and do it properly, u will get output as 20,9

  • @MrANANDARAJA
    @MrANANDARAJA Před 5 lety

    19 , 9 only boss

  • @Andrew_EvsW
    @Andrew_EvsW Před 7 lety

    Hello , using Code:blocks and the OP: of the program is :19,9
    Can you please give us a feedback why we are getting diffrent results?
    P.S kepp up the good work :) !

    • @arnabsom3251
      @arnabsom3251 Před 7 lety

      its because of the compiler different compiler gives different lexical values based on the tokens generated by the threads

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

      stupid answer . The actual answer is that modify operators have higher precedence than airthematic . so first whole expression is evaluated for modify operators then value is subsituted and then the expression is evaluated

    • @AmanGupta-ph5sd
      @AmanGupta-ph5sd Před 4 lety

      In today's compiler the concept used by sir is not used..... modern IDE includes ATOM,CODE BLOCK which uses GCC COMPILER and they have entirely different concept to solve this problem IF U WANT TO LEARN THAT CONCEPT I WILL recommend
      you to go through this youtube channel they have modern concept and easy way for understanding whole concept czcams.com/video/yRt-zYFJIvE/video.html

    • @murgan4307
      @murgan4307 Před rokem +1

      @@lawn_mower4941
      this is ok all discusion

  • @medhasaha817
    @medhasaha817 Před 4 lety +1

    Output is 20 and 9.

  • @lakshmibmaddasani3937
    @lakshmibmaddasani3937 Před 5 lety +3

    He is completly wrong
    Its output is a=20; b=9; i executed in jdk

  • @duggirambabu7792
    @duggirambabu7792 Před 2 lety

    *Output:* 20, 9

    • @murgan4307
      @murgan4307 Před rokem

      19,9

    • @murgan4307
      @murgan4307 Před rokem

      Turbo c
      compiler ans is : 18,8
      gcc compiler ans is : 19,9
      output is depend on your compiler (software)

    • @singamhariharan7459
      @singamhariharan7459 Před 10 měsíci

      ​@@murgan4307bro don't follow the compiler, follow the concept of increment operators and do it properly, u will get the output as 20,9

  • @kiranbs5057
    @kiranbs5057 Před 5 lety +1

    Answer is wrong !! ...wrong explanation

  • @priyadilsha1162
    @priyadilsha1162 Před 7 lety +5

    Hi Sir,
    I wrote this program in C and it gave me a result of 19, 9. Can anyone explain?
    Thanks

    • @tanyaplovesmusic
      @tanyaplovesmusic Před 7 lety +1

      same

    • @babumandal5646
      @babumandal5646 Před 7 lety

      It depend on compiler....

    • @mdnizamraza7939
      @mdnizamraza7939 Před 6 lety +4

      The value comes 19 and 9 becz of the order of evaluation and also due to the cause of no any sequence point in the first expression to evaluate b..
      b undergoes evaluation like this:
      As post increment and post decrement are of same precendence hence
      b=4+5=9
      First in a++ the value of a is substituted and then it gets incremented and after that in a-- value of incremented 'a' is substituted and then it undergoes decrement by 1 Hence result comes 9

    • @deepjyotide3223
      @deepjyotide3223 Před 5 lety +1

      @@mdnizamraza7939 a comes out to be 20

    • @laljiniranjan3276
      @laljiniranjan3276 Před 5 lety

      I think correct answer is a=11 and b=9....

  • @amar-eu7cw
    @amar-eu7cw Před 4 lety

    Why answer becomes 19 9 why +1

  • @ravulamanjula4397
    @ravulamanjula4397 Před 4 lety +2

    The answer must be 9,20 .

  • @slfactvideo298
    @slfactvideo298 Před rokem

    Hindi me translation

  • @hatredknight9964
    @hatredknight9964 Před 5 lety +1

    Listen all java is better than c

  • @amitkumarmahapatra4829

    int i=5;
    printf("%d %d
    ", i, i=i++) ;
    printf ("%d
    ", i);
    i=i++;
    printf ("%d
    ", i);
    I am getting output as
    5 5
    5
    6
    Why there is no change inside printf statement but outside printf there is a change!!!
    I compiled this in turbo C compiler

    • @parekhhimanshu9641
      @parekhhimanshu9641 Před 5 lety

      Try by storing i++ in another variable then there will be change

    • @revanthsaiesh67
      @revanthsaiesh67 Před 4 lety +1

      i++ ---> 1)old value is assigned 2) then increment is done
      ++i--> 1)value is incremented 2)new value is assigned.
      Ex:-
      #include
      int main()
      {
      int a=5;
      printf("%d",a++);
      printf("%d",a);
      printf("%d",++a);
      printf("%d",a);
      }
      The output of your code will be
      5
      6
      7
      7
      There is no point of assigning i=i++ because both output will be same.
      Hope you understand

  • @pokigamerop
    @pokigamerop Před 2 lety

    22

  • @meghasyam427
    @meghasyam427 Před 6 lety

    prgram gave 19 9 as output

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

      in first step i.e, b=(a++)+(a--)
      b=(4)+(5)=9
      after taking a++ as 4 its an post increment so for a-- we get 5

    • @deepjyotide3223
      @deepjyotide3223 Před 5 lety +3

      @@durgavarshith9596 how is a = 19 and not 20?

  • @shubhamsharma4113
    @shubhamsharma4113 Před 4 lety

    Bsdk galat hai

  • @devbisht1819
    @devbisht1819 Před 6 lety +1

    galat padhaane se acha plzz dont upload videos i tried solving,, method hi glat hai

  • @Anishkumar-bj1sp
    @Anishkumar-bj1sp Před 5 lety +1

    18, 8 is correct answer