C_78 Problems on Pointers | Important question with answer

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

Комментарии • 442

  • @jaijaijaijai123
    @jaijaijaijai123 4 месяца назад +15

    In the statement printf("%d %d %d
    ", (*p)++, *p++, *++p);, it might seem that the operations should be evaluated from right to left due to operator precedence or associativity, but that's not how function argument evaluation works in C.
    Understanding the Concept:
    Operator Associativity vs. Function Argument Evaluation:
    Operator Associativity refers to how operators of the same precedence are grouped in the absence of parentheses (e.g., a + b + c is left-to-right because + is left-associative).
    However, function arguments in C are not evaluated based on the associativity of the operators within the arguments. Instead, the order of evaluation of function arguments is unspecified in the C standard.
    Unspecified Evaluation Order in C: The C standard does not define the exact order in which function arguments are evaluated (i.e., whether arguments are evaluated left-to-right, right-to-left, or in any particular order). This means that depending on the compiler, the order can vary. Most modern compilers tend to evaluate arguments from right to left, but it’s not guaranteed, and the standard doesn’t mandate it.
    Side Effects with Increment Operators: In this case, the post-increment and pre-increment operators (++) introduce side effects, which change the value of p (the pointer) during argument evaluation. This makes it tricky to predict the exact output without knowing how the compiler evaluates the function arguments.
    Example Breakdown:
    Let’s analyze what happens in the statement printf("%d %d %d
    ", (*p)++, *p++, *++p);.
    (*p)++:
    This returns the value that p points to (dereferenced), then increments the value at p.
    *p++:
    This returns the current value at p, then increments the pointer p to point to the next location.
    *++p:
    This first increments the pointer p, then returns the value at the new location.
    Now, based on how the compiler decides to evaluate the arguments, the exact order of pointer increments and dereferencing will differ.
    Why Associativity Doesn’t Apply:
    Operator associativity applies when you have multiple operators of the same precedence in a single expression (like a + b + c).
    Function argument evaluation is not governed by associativity rules but by the fact that the C standard leaves the order of evaluation unspecified. Therefore, associativity doesn't determine how arguments like (*p)++, *p++, and *++p are evaluated.
    Conclusion:
    The evaluation order of the arguments in printf is unspecified, meaning the compiler can choose the order in which these arguments are processed. This is why associativity (whether right-to-left or left-to-right) does not govern the behaviour here. The key takeaway is to avoid relying on the evaluation order when using side-effect-producing expressions like ++ in function arguments, as the result may vary across compilers.

    • @zag3sh
      @zag3sh 3 месяца назад

      I put the code on chatgpt and it gave output different than gcc compiler. Thanks, your comment was helpful.

    • @studyfluff9636
      @studyfluff9636 Месяц назад +1

      thank you!

  • @DharmeshT-j6q
    @DharmeshT-j6q 8 месяцев назад +8

    wow. Studying become more interesting after such problems....especially for beginners

  • @shivendra3019
    @shivendra3019 3 года назад +62

    Jenny the Robot. Happy Independence Day Mam.

    • @coding1415
      @coding1415 3 года назад

      ruclips.net/video/r2xHolThGj4/видео.html

  • @visvasprabhakar9428
    @visvasprabhakar9428 2 года назад +14

    I think that pointer topic is so tough...but when I saw your lecture it so simple ..for me ,thank you mam...really that you given problem are make practice

  • @YtMindMatrix300
    @YtMindMatrix300 11 месяцев назад +3

    Thank you mam for a wonderful explanation . Mam I have one that is we are going to get the output of star p as zero in that case why the value got changed in place of -1 to 0 . In the first code problem.

  • @sohaibirshad4778
    @sohaibirshad4778 3 года назад +9

    thanks mam for helping us specially in present era..it is a very famous maxim that people help u ,u r lucky if people don't help u its very common.i have seen 1st 20 video in a day ..all are quite interesting and understandable. I have learnt more.thsnks

  • @hammadhamyuain2427
    @hammadhamyuain2427 3 года назад +8

    Your way of teaching is unique. Love and respect from Pakistan❤

  • @chinweokwugiftchiedozie1587
    @chinweokwugiftchiedozie1587 2 года назад +30

    1. p = 12, 11, 11
    2. p = 13
    3. p = 13
    4. p = 14
    5. q = 67
    6. p = 54
    7. p = -2 Though I got -2 as my answer to this, when I checked in on my computer it was giving multiple outputs, so each time I run the code, it varies. Why??

    • @abhishekrajput8392
      @abhishekrajput8392 2 года назад +2

      How -2?

    • @abhishekrajput8392
      @abhishekrajput8392 2 года назад

      Pl type here this code

    • @nanditagiridharan1197
      @nanditagiridharan1197 Год назад +10

      Yes , last output gives a fluctuating output bcs the pointer is not pointing to any of the array element and the reason behind this is 1st of all the pointer is pointing to index a[1] (not a[3] as we assume, although in 6th step it's p+2 there's no change in p pointer it's still pointing to p i.e a[1] ) , 2nd p++ is post increment so p++-2 means pointing to a[-1] there's no such location and a random garbage value at this location minus 1 is the answer we are getting for *(p++-2)-1, hence we get fluctuating output

    • @piyushpiyush295
      @piyushpiyush295 Год назад

      Because in question there is
      P=a not p=&a

    • @abhi_ki_baate
      @abhi_ki_baate Год назад

      yes bro why?

  • @adityanair1200
    @adityanair1200 Год назад +5

    how to understand the assossiactivity at 2:48 that it is right to left ??

    • @user-cg8hs8ji6b
      @user-cg8hs8ji6b 8 месяцев назад

      for printf statement the assossiactivity is right to left

  • @oyebamijimustapha7846
    @oyebamijimustapha7846 2 года назад +7

    Thanks very much for the well-detailed video. It clear my conceptions on pointer.

    • @ananyaghosh6402
      @ananyaghosh6402 2 года назад

      but didn't mam say that we cannot add two pointers

  • @shivammishra7671
    @shivammishra7671 2 года назад +6

    Ma'am it's a request please make a course on Java also.
    U teach amazingly
    Thank you ma'am

  • @SuprovatBhattacharjee
    @SuprovatBhattacharjee 2 года назад +7

    At 11:00, In printf("%d
    ", *(p++-2)-1) , my calculation is coming -2, but the output is showing -3. Plz explain it.

    • @sumitno10
      @sumitno10 2 года назад +1

      My compiler gives -1 while according to my calc it's -2

    • @Lokesh_yadav__
      @Lokesh_yadav__ 2 года назад

      @@sumitno10 same condition here

    • @madhavan.1209
      @madhavan.1209 2 года назад

      @@Lokesh_yadav__ here also same output is -1 but i guess -2 or (14 while p is post icrement)

    • @apehendurance1776
      @apehendurance1776 2 года назад +1

      It is suppose to return a garbage value

    • @apehendurance1776
      @apehendurance1776 2 года назад

      I can explain if you want

  • @kashishrocks
    @kashishrocks 9 месяцев назад +5

    8:56 why are we geeting -3 for the last one when i dry i get -2

    • @yashpatil6670
      @yashpatil6670 6 месяцев назад

      Yes, I also got -2

    • @andydufresne436
      @andydufresne436 5 месяцев назад

      @@yashpatil6670 But how did you get -2? I also 've doubt in it.
      Just before executing last line:
      p = &a[1] (also, currently a[1] is =15 ).
      On execution, (p++ -2) , p is assigned the same (&a[1] ), then incremented (which doesn't matter in this line). so, now it is '&a[1] - 2' (-2 address from current p address), i.e., = &a[-1] ???
      So, I thought it should print a garbage value, but it prints 0 for *(p++ -2) and then *(p++ -2) - n = - n. So, here answer is -1..🤷🏽
      If you 've any doubt, then check,
      1. '(*p++ -1) ' , you get 10 (=a[0]).
      2. (*p++) or *p , you get 15 (= current value of a[2])
      ?? How does a[-1] get result = 0.. or is there anything wrong in above inference?

  • @manirulmolla6105
    @manirulmolla6105 2 года назад +10

    Your way of explanation is always awesome, very enjoyable, interesting and easy to absorb. Thank you so much!!! Keep up the good work☺

  • @SravanKumar-uc6qt
    @SravanKumar-uc6qt 3 года назад +3

    Nice t-shirt, nice hair, introducing you self is professional,
    Thinking imagination,
    Respected,

    • @coding1415
      @coding1415 3 года назад

      ruclips.net/video/r2xHolThGj4/видео.html

  • @jegadeeswarapandian6996
    @jegadeeswarapandian6996 3 года назад +16

    🌟🌟Mam, when will you upload Object Oriented Programming (OOPs)videos mam, waiting alot to see !!!!!! 🌟🌟

  • @ajjubhai50000
    @ajjubhai50000 Год назад +2

    4:38 mam but *p is in bracket so first it should have been solve plz reply mam

  • @nikunjlotiya3099
    @nikunjlotiya3099 7 месяцев назад

    Best question to practice 👌thank you❤

  • @kancharlapalligopika3690
    @kancharlapalligopika3690 Год назад +1

    Mam I didn't get the last printf statement *(p++ -2)-1; in the assignment you gave.

  • @Vishal-zw4hn
    @Vishal-zw4hn 3 года назад +3

    Thank you ma'am for such wonderful explanation....

  • @CodeSnap01
    @CodeSnap01 3 года назад +2

    Mam your voice sounds exactly of a strict teacher.

  • @Userx123-z3m
    @Userx123-z3m 9 месяцев назад +1

    i got (-3) on the last one any explainations why i got that ? i tried the code on the white board not the one on the computer.

  • @shamshadansari6430
    @shamshadansari6430 3 года назад +9

    Ma'am please upload remaining lectures of pointer and also make videos on structure and function

  • @dreypraydev
    @dreypraydev Год назад +6

    Here you will see the exercises listed with some commands that will lead you to their answers. You can also copy the code and run it in your IDE for better understanding. Hope it will help you all.
    #include
    int main() {
    int a[] = {10, 11, -1, 56, 67, 5, 4};
    int *p, *q;
    p = &a[0];
    q = &a[0] + 3;
    printf("---------------
    ");
    printf("1. %d
    ", *p); // Answer: 10
    printf("2. %d
    ", *q); // Answer: 56
    printf("3. %d %d %d
    ", (*p)++, (*p)++, *(++p)); // Answer: 12 11 11
    printf("4. %d
    ", *p); // Answer: 13
    printf("5. %d
    ", (*p)++); // Answer: 13
    printf("6. %d
    ", (*p)++); // Answer: 14
    q--; // q at -1 value
    printf("7. %d
    ", (*(q + 2))--); // Answer: 67
    printf("8. %d
    ", (*(p + 2)) - 2); // Answer: 15
    printf("9. %d
    ", *(p++ - 2) - 1); // Answer: garbage value | out of array
    printf("---------------
    ");
    return 0;
    }

    • @AbdulRahmanHarris
      @AbdulRahmanHarris Год назад +8

      for 8. ans is 54

    • @priyanshaaggarwal7723
      @priyanshaaggarwal7723 Год назад

      How 3 is 12 11 11 ?

    • @itsmeshyam1436
      @itsmeshyam1436 Год назад +1

      @@priyanshaaggarwal7723
      The expressions are evaluated from right to left. So first *(++p) on the right, then (*p)++ in the middle, then (*p)++ on the left.
      Initially p points to 10.
      *(++p) on the right:
      Pre-increment followed by dereference.
      p is made to point to the next location first, then the value is printed. So this gives 11 on the right.
      (*p)++ in the middle:
      Value at p is first returned, then the value at that location is incremented. (The pointer does not move.)
      So this gives 11 in the middle. Now the value of a[1] is no longer 11, but 12.
      (*p)++ on the left:
      Value at p is first returned, then the value at that location is incremented. (The pointer does not move.)
      So this gives 12 on the left. Now the value of a[1] is no longer 12, but 13.
      The array after this step is {10,13,-1,56,67,5,4}.

    • @itsmeshyam1436
      @itsmeshyam1436 Год назад

      I got statement number 9 to be -1 after compiling and running the code multiple times. I did not understand the logic for that output. Can someone please explain that last statement?

    • @forestworldtv8989
      @forestworldtv8989 Год назад

      ​@@itsmeshyam1436 Which was statement number line?

  • @shakthi3331
    @shakthi3331 3 года назад +2

    Hello mam,
    I Ioved and learned more from your videos thanku so much

  • @rakeshandhavarapu5759
    @rakeshandhavarapu5759 3 года назад +3

    Happy independence day mam tq for helping us to achieve our goals 😀😍🇮🇳🇮🇳

  • @JUNIOR-j4nior
    @JUNIOR-j4nior 3 года назад +8

    I am in 12 now ... Unable to relate to anything , still watching 😂
    Beauty with Brains 🤠😜
    Thanks mam for all the essential vedios u had provided us but our comp exam was cancelled , a hard luck 👍👍👍

  • @elijahmikaelson740
    @elijahmikaelson740 3 года назад +7

    ma'am but precedence of post increment /post decrement is greater than pre increment/decrement but you said ++p would be solved first(when second time printf function is used) plz ma'am try to solve my doubt🙏🙏🙏🙏
    If someone else is having answer for this then help me out

    • @elijahmikaelson740
      @elijahmikaelson740 3 года назад +1

      ma'am plz do not ignore this comment🙏🙏🙏🙏

    • @brokenheart-vd6to
      @brokenheart-vd6to 2 года назад +1

      Are bro associativity check karo.
      Our iski associativity left to right hai.

    • @lillyput2275
      @lillyput2275 2 года назад +1

      Yes she has given wrong info little bit , 7:02 it is left to right she said it’s right to left

    • @gweri91
      @gweri91 2 года назад +1

      @@lillyput2275 Can you please explain at 4:15 for
      (*p)++, *p++,*++p why we took assosciativity right to left

    • @lillyput2275
      @lillyput2275 2 года назад +1

      @@gweri91 unary operators having associativity right to left

  • @arjungaur1098
    @arjungaur1098 3 года назад +6

    I watch your videos from Argentina. Keep up the good work.

    • @PoCoPratham
      @PoCoPratham 3 года назад

      U r on social media like Telegram or twitter ?

  • @abdulrahimjalloh363
    @abdulrahimjalloh363 Год назад +4

    Assignment submission. i will on types the answers
    p1: .........12......11.........11
    p2........13
    p3.........13
    p4...........14
    p5...........67
    p6...............54
    p7............-1
    but mam, p7 is my problem, how does it give -1 i dont understand. please help

  • @pavanajmeera9009
    @pavanajmeera9009 3 года назад +12

    printf("%d",*(p++ -2)-1) in this statement(in assignment qun) after executing till beforer this statement p is at address holding 56 number.as p is post increment, (p++-2) points the p to the address holding -1. then *(p)-1 =-1-1=-2. i guessedd this is the answer. but compiler is showing -1(final answer). could u plz xpalin how this(p++ -2) is working....

    • @Unknown-uo7yy
      @Unknown-uo7yy 3 года назад +12

      (p++-2) is post decrement so p++ is moreover same as p in this line, now p is address of number 15 ,p-2 which is out of array like index -1. so its taking value as 0,atlast -1 is add ,so output is -1.if u change -1 with any number it'll reflect in output

    • @manpreetkhalsa3265
      @manpreetkhalsa3265 2 года назад +2

      actually the position of pointer doesnot changes until you are not storing it. here we are just having some arithmetic solving .Before the statement you have mentioned the p is holding the value 15 only there was no change in position of pointer

    • @invincible9971
      @invincible9971 2 года назад

      Could you please tell the output of the 1st printf statement of this example?

    • @manpreetkhalsa3265
      @manpreetkhalsa3265 2 года назад +2

      @@invincible9971 12 11 11

    • @mahivarshini439
      @mahivarshini439 2 года назад

      Can you please explain last 3 outputs?

  • @urheartischild2
    @urheartischild2 8 месяцев назад

    3:56 mam isme doubt h. Jb number icreament hui to uski adress v to change hogi?
    Please answer 🙏🏻

  • @techtemple1
    @techtemple1 3 года назад +4

    Ma'am... I have watched many of your videos when i wasn't into IT branch.. But now i am learning java and i am not having IT CS background... I literally get irritated while learning program flows.. And i simply don't get it... Please help with some tips.. Much love to you🖤

  • @sarabantahura7466
    @sarabantahura7466 2 года назад +3

    @jenney's lecture CS/IT NET&JRF last out I go -2 but when I run got -3

  • @gokulharan
    @gokulharan Год назад +5

    mam answer is p term is 12 11 11 and
    in manually I get 12 13 14 in compiler printf("%d",*p) this term is 13 get confused and then 13 13 14 in q term 56 -1 67 54 when last one printf("%d",*(p++ -2)-1) in manual I got 2 in compiler -1
    two thing goes doubt and one more p is in 104 address p++ means 108 -2 value is 108 address -1 (-1-2)-1 is that this is correct ?

  • @SravanKumar-uc6qt
    @SravanKumar-uc6qt 3 года назад

    Well respected madam zi,
    Introducing this exceeding program,
    Must notify

  • @HarshitYadav-g4r
    @HarshitYadav-g4r Год назад

    i love your teaching style❤❤

  • @KaturiPavankalyan
    @KaturiPavankalyan Месяц назад +2

    You taught we can't add two pointers

  • @komalgarg12
    @komalgarg12 2 года назад +3

    Ma'am what is the difference between p=&a and p=a

    • @ankitswain7775
      @ankitswain7775 2 года назад

      If P is a pointer then in 1st case p will store the address of a

    • @apehendurance1776
      @apehendurance1776 2 года назад

      As long as p is a pointer you can store the address of a by using p=&a or p=a.

  • @Xyz-x6m9n
    @Xyz-x6m9n 2 месяца назад

    Mam maza aagya 😊

  • @MkS23_12
    @MkS23_12 3 года назад +2

    Mam please continue C programming playlist

  • @dyumnar6864
    @dyumnar6864 Год назад +1

    printf("%d",*(p++ -2)-1) in this statement(in assignment qn) after executing till beforer this statement p is at address holding 56 number.as p is post increment, (p++-2) points the p to the address holding -1. then *(p)-1 =-1-1=-2. this is the answer by theory. but compiler is showing -1,-3 in other compiler,. could u plz expalin how this(p++ -2) is working....

    • @eswari1709
      @eswari1709 Год назад +1

      i got this as answer for this statement 32765
      it doesnt make sense

    • @ananthu4141
      @ananthu4141 Год назад +1

      Bruh can u please explain me how the inner statement woks(p++ -2)....bc currently p is in 112(56)...and after doing p++(after using original location then inc..) P is still in 112 & subtracting 2 locations we get 104(11) and after completion we get 11-1==10 this is how i get... Plz correct me bruh

    • @kashishrocks
      @kashishrocks 9 месяцев назад +1

      same problem

  • @abdelhamidahbane6322
    @abdelhamidahbane6322 2 года назад +1

    why the printf function will start executing from the last value backwards !!!?

  • @kakarlapavani7376
    @kakarlapavani7376 3 года назад +4

    Mam upload python videos also💥✨

  • @surajsuryawanshi6306
    @surajsuryawanshi6306 3 года назад +3

    Thank you ma'am keep it up with lot's of problems. It is always good to learn for success

  • @ft.nahiyan
    @ft.nahiyan Год назад +1

    @10:08 Assignment:
    #include
    int main()
    {
    int a[] = { 10, 11, -1, 56, 67, 5, 4 };
    int *p, *q;
    p = a;
    q = &a[0] + 3;
    // commented outputs are in right to left order

    printf("p = %d
    ", *p); // 10
    printf("q = %d
    ", *q); // 56
    printf("%d %d %d
    ", (*p)++, (*p)++, *(++p)); // 11, 11, 12
    printf("%d
    ", *p); // 13
    printf("%d
    ", (*p)++); // 13
    printf("%d
    ", (*p)++); // 14

    q--; // -1
    printf("%d
    ", (*(q + 2))--); // (*(-1 + 2))--) >> (67)-- >> 67
    printf("%d
    ", *(p + 2) - 2); /* *(p + 2) - 2 >> *(11 + 2) - 2 >> *56 - 2 >> 54 */
    printf("%d
    ", *(p++ - 2) - 1); /* *(p++ - 2) - 1 >> *(14 - 2) - 1 >> *12 - 1 >> 11 */
    /*
    line 19 :
    >> The pointer p points to the element a[1], which has the value 14.
    >> The expression p + 2 adds 2 to the pointer p, which means that it returns the address of the element a[3], which is two elements ahead of a[1].
    >> The expression *(p + 2) dereferences the address returned by p + 2, which means that it accesses the value of the element a[3], which is 56.
    >> The expression *(p + 2) - 2 subtracts 2 from the value of *(p + 2), which means that it returns 56 - 2, which is 54.

    line 20 :
    >> The pointer p points to the element a[1], which has the value 14.
    >> The expression p++ - 2 subtracts 2 from the pointer p, which means that it returns the address of the element a[0], which is two elements behind a[1]. Note that p++ also increments p by 1, so that p now points to the element a[2], which has the value -1, but this does not affect the expression p++ - 2, which uses the old value of p.
    >> The expression *(p++ - 2) dereferences the address returned by p++ - 2, which means that it accesses the value of the element a[0], which is 12.
    >> The expression *(p++ - 2) - 1 subtracts 1 from the value of *(p++ - 2), which means that it returns 12 - 1, which is 11.
    */
    }

  • @riyagupta1841
    @riyagupta1841 3 года назад +1

    Mam pointers ke aage videos upload kijie jaldi pls 😅.
    Waiting eagerly for next video and one request to you daily upload one video ☺️

  • @hasini6941
    @hasini6941 2 месяца назад +2

    Mam we need answer 9:13 plz mam

  • @UPESridhar
    @UPESridhar 3 года назад +4

    Mam why ur not uploading videos
    IAM waiting for further chapters.
    Please try to make it fast and smooth 😊🙏

  • @vipparthibhargav1212
    @vipparthibhargav1212 11 месяцев назад

    mam,you said we can't perform addition on two pointer variable in previous videos. but now in this video at the end of the program why you added two pointer variables???

    • @tanmay5070
      @tanmay5070 5 месяцев назад

      the pointers were not added, the values to which the pointers were pointing to were added

  • @lakshmipriyas8780
    @lakshmipriyas8780 3 года назад +2

    9.57 how is addition of 2 pointers is possible mam?
    In C_75 (addition) video...u have told addition of two pointers is not possible. Then how mam?

  • @PraveenKumar-vd8ev
    @PraveenKumar-vd8ev 9 месяцев назад

    Why is the printf function evaluating from right to left but printin them left to right...This is like something undefined behaviour..

  • @KushagraRichhariya
    @KushagraRichhariya Год назад

    4:16 what about precedence

  • @shamshadansari6430
    @shamshadansari6430 3 года назад +2

    Ma'am why are you not uploading next lectures of pointer now

  • @srijaanna7698
    @srijaanna7698 6 месяцев назад

    mam, why did u write p=a?? but actually pointer stores address of a right??

    • @tanmay5070
      @tanmay5070 5 месяцев назад +1

      the array name holds the base address of the array, hence they are often referred to as
      "internal pointer variable"

  • @kiara4284
    @kiara4284 3 года назад

    Hi miss!!
    Your smile is like my favorite actresses : -
    Shruti Sharma and Rashmika Manndana!!!

  • @shrutikumarimahatacst9497
    @shrutikumarimahatacst9497 2 года назад

    You are amazing mam , I wish I will meet with you ...😊

  • @devSackey
    @devSackey Год назад +6

    1. 12 11 11
    2. 13
    3. 13
    4. 14
    5. 67
    6. 54
    7. -2
    Thanks mum. i was able to do this with ease

    • @nikithaa.s683
      @nikithaa.s683 Год назад

      Do we get - 2 or any other garbage value for last one

    • @devSackey
      @devSackey Год назад

      @@nikithaa.s683i got - 2 on paper but the compiler showed a garbage value

    • @nikithaa.s683
      @nikithaa.s683 Год назад

      @@devSackey okey tq

    • @goplay5936
      @goplay5936 Год назад

      Shouldn't no. 5 be 66?

    • @devSackey
      @devSackey Год назад

      @@goplay5936 no bro its should be 67. Cross check with your compiler to confirm

  • @amolchaugule8294
    @amolchaugule8294 3 года назад +7

    Mam c++ bhi sikao na

  • @abhisheksahgamerz4138
    @abhisheksahgamerz4138 3 года назад +2

    Happy Independence Day Mam

    • @coding1415
      @coding1415 3 года назад

      ruclips.net/video/r2xHolThGj4/видео.html

    • @saikiranyadav9127
      @saikiranyadav9127 2 года назад +1

      JAISHREEGANESHHARHARMAHADEVMATAJI

  • @codetester2161
    @codetester2161 3 года назад

    yrrrr..ye mam kitti awesome hai yaaar

  • @ksgharshitha5784
    @ksgharshitha5784 3 года назад +2

    hi mam,I am an ECE graduate.Can i attempt CS gate and join CS mtech?If YES,Please tell pros and cons of attempting CS gate and after opportunities mam,Please help mam

  • @muhammadusamamuhammadusman7695
    @muhammadusamamuhammadusman7695 3 года назад

    Ma'am Please 🙏 Java ka course bhi start kar de it''s a request. Lots of love and respect for you from Pakistan.

  • @lakeshnampelly2196
    @lakeshnampelly2196 8 месяцев назад

    Could any of you people help me with the last line of the code where it's getting an error.

  • @rudranshmahore9009
    @rudranshmahore9009 3 года назад +1

    Happy Independence Day Ma'am🇮🇳🇮🇳

  • @xaviball2911
    @xaviball2911 2 года назад

    love you mam first time I tried and i got right

  • @NNN-sl3pd
    @NNN-sl3pd 2 года назад

    ma'am the assignment which gave you to us i tried it but it gives garbage values

  • @vigneshmanohar3269
    @vigneshmanohar3269 3 года назад +1

    Mam pls upload more videos on C as soon as possible mam

  • @learningwithankit8701
    @learningwithankit8701 3 года назад +13

    Answers are:
    12 11 11
    13
    13
    14
    67
    54
    some garbage values

  • @byAn_INDIAN
    @byAn_INDIAN Год назад

    thanks mam. it will help
    in the gate

  • @indhureddy9477
    @indhureddy9477 2 года назад

    Happy teacher's day mam

  • @richiagrawal1616
    @richiagrawal1616 2 года назад +2

    Thankyou ma'am for making pointer so easy to understand.. I got the same output as I have solved it on paper. Only last line is giving -1 as output but i am getting -2 on paper. Thankyou ma'am💛

    • @gyanendarkaur2283
      @gyanendarkaur2283 2 года назад

      3:08 can anyone plz explain me that int a[ ] this bracket should have value 10 according to number of elements in array but she took 100.....? Why yaar plz koi samjado mujhe plz🙏

    • @apehendurance1776
      @apehendurance1776 2 года назад +1

      @@gyanendarkaur2283 she assume the 100 to be the address of the first index in the array . Remember int a is automatically storing the address of the first index

    • @nanditagiridharan1197
      @nanditagiridharan1197 Год назад +1

      @@gyanendarkaur2283 it's not array index , it's 1st array element's address in memory , she has taken 100 for easy understanding, although address in memory is usually in hexadecimal form

    • @flames_tech
      @flames_tech Год назад

      @@nanditagiridharan1197 Guys can anyone explain why printf("%d
      ",*(p++ -2)-1); this line giving -1 output, Because My logics are not working on paper..... If I run it on online compiler its giving Garbage value and On VS code its Giving -1.... No idea whats happening, According to me it should give another answer

    • @nanditagiridharan1197
      @nanditagiridharan1197 Год назад +1

      @@flames_tech If we apply proper logic we will get the output as -1 itself , because in the last second step p is pointing to 4th element(56) right.........so in the last step p is currently pointing to address of (56) ,then as per question brackets hv higher precedence......so inside brackets we hv (p++ -2) where ±± increment operator has higher precedence so p is now pointing to (67) and then -2 suggests taking pointer p back by 2 positions i.e now p is pointing to address of (-1)............then once we solved within the brackets we have *(address of(-1 )) - 1........so * operator has higher precedence therefore print -1 as output and finally [ in array -1-1=-2 will be stored in that location but it wont reflect in the output ].............hence the output -1 !
      Hope it's clear.....

  • @anujchaudhary4195
    @anujchaudhary4195 3 года назад +1

    When c program last vedio will updated

  • @petereziagor4604
    @petereziagor4604 2 года назад

    Thanks for the quiz. I thought I understood it well till I tried them out.

    • @meghamoni6626
      @meghamoni6626 2 года назад +1

      What's answer??
      Can you explain??
      12,11,11
      13
      13
      14
      67...
      Why 67???
      Can you explain it??
      And last one -3..why??

    • @diaaassem
      @diaaassem Год назад

      ​@@meghamoni6626 67 because the line of q--​

  • @KrishnaGupta-he1sz
    @KrishnaGupta-he1sz 3 года назад

    6:34 mam ye kese pata chalega right se karna hai ya left se

    • @ChirantanSadhu
      @ChirantanSadhu 3 года назад

      Precedence order hain ek .Follow the upper videos of the playlist.

  • @mdrahul7343
    @mdrahul7343 2 года назад

    Abha muje chakkar ane lage ha 🥴......
    just kidding I like the way you teach.. (thank you 😊...)

  • @DesiLadka_BikeVloger
    @DesiLadka_BikeVloger 2 года назад

    Mam In second prinf you discussed about first %d is value is zero but we are getting -1

    • @vamsi9362
      @vamsi9362 7 месяцев назад

      It's a post increment
      First value will be assigned that is -1
      and will be incremented to 0
      Next line u are getting 0.😊

  • @viraj6523
    @viraj6523 Год назад

    As per my calculation first printf statement output should be 12 11 11 but i got 10 11 11 how ??

  • @siddharthraj8531
    @siddharthraj8531 3 года назад

    I open the video because of ur picture in thumbnail and then realized that it's a programming video.....and now I have learned most of the topic of C ...🤣🤣🤣🤣🤣🤣

  • @roboygaming2877
    @roboygaming2877 3 года назад

    Gujarati English accent🤩🤩👍👍

  • @meghasinha1706
    @meghasinha1706 3 года назад

    Thanks for your efforts mam

  • @nishasiddu5487
    @nishasiddu5487 6 месяцев назад

    Hi jenny I tried manually first am able to trace most of the questions only three things I have a doubt. If it's possible, could you please help give an explanation for below one.
    1. printf("(*(q+2)--)=%d
    ",(*(q+2))--); -> for this my manual output and the compiler output is same but after this statement i tried to print *q but the compiler shows -1 value, but my manual output is 56 am confused why this difference can you please give answer for this.
    2. printf("*(p++ -2)-1=%d
    ",*(p++ -2)-1); -> can you please explain this also.

    • @andydufresne436
      @andydufresne436 5 месяцев назад

      Can you share your full code? I'm confident to help you clear your 1st doubt, I got the answer in dry run and in compiler run.

    • @andydufresne436
      @andydufresne436 5 месяцев назад

      2nd Qn is a real doubt. My observations are given below:
      Just before executing last line:
      p = &a[1] (also, currently a[1] is =15 ).
      On execution, (p++ -2) , p is assigned the same (&a[1] ), then incremented (which doesn't matter in this line). so, now it is '&a[1] - 2' (-2 address from current p address), i.e., = &a[-1] ???
      So, I thought it should print a garbage value, but it prints 0 for *(p++ -2) and then *(p++ -2) - n = - n. So, here answer is -1..
      If you 've any doubt, then check,
      1. '(*p++ -1) ' , you get 10 (=a[0]).
      2. (*p++) or *p , you get 15 (= current value of a[2])
      ?? How does a[-1] get result = 0.. or is there anything wrong in above inference?

  • @JF59122
    @JF59122 Год назад

    Ma'am I'm not able to understand how the last one is a random value...

  • @ahmedabubakar7972
    @ahmedabubakar7972 2 года назад

    is anyone else getting a warning of unsequenced modification?

  • @GalaxyCookies76
    @GalaxyCookies76 2 года назад

    The statement : printf("%d",(*(q+2)--) is showing an error => lvalue required as decrement operand

    • @gyanendarkaur2283
      @gyanendarkaur2283 2 года назад

      3:08 can anyone plz explain me that int a[ ] this bracket should have value 10 according to number of elements in array but she took 100.....? Why yaar plz koi samjado mujhe plz🙏

    • @apehendurance1776
      @apehendurance1776 2 года назад

      @@gyanendarkaur2283 when u declare a variable containing an array of numbers the variable declared automatically hold the address of the first element in the array. Jenny just assume 100 to be the address of the first element int the array that is why is storing 100. You can also say it a pointer holding the address of the first element in the array.
      I hope this help.

    • @apehendurance1776
      @apehendurance1776 2 года назад

      Did u end it with a semi Column ??

    • @chinweokwugiftchiedozie1587
      @chinweokwugiftchiedozie1587 2 года назад

      Same here
      I have too many errors on my system which was not expected according to my logic 😆

  • @danthamravi5643
    @danthamravi5643 3 года назад

    Ma'am
    make a video Job's on without coding and programming.

  • @rameshv387
    @rameshv387 Год назад

    Mam I run that program in my compiler but not correctly showing all values , can you please help me

  • @moonscope1148
    @moonscope1148 2 года назад +5

    the output of *(p++ - 2) - 2 is showing -1 in my machine, but couldn't understand why please explain ma'am.

    • @gyanendarkaur2283
      @gyanendarkaur2283 2 года назад +1

      3:08 can anyone plz explain me that int a[ ] this bracket should have value 10 according to number of elements in array but she took 100.....? Why yaar plz koi samjado mujhe plz🙏🙏

    • @moonscope1148
      @moonscope1148 2 года назад

      ​@@gyanendarkaur2283 that 100 is the address of first element of the array, its just a assumption.

    • @gweri91
      @gweri91 2 года назад

      Can you please explain at 4:15 for
      (*p)++, *p++,*++p why we took assosciativity right to left
      Plz🙏

    • @moonscope1148
      @moonscope1148 2 года назад +2

      @@gweri91 opertors with same precedence are present, so associativity is from right to left in those operators , you can check the precedence table of operators for C.

    • @gweri91
      @gweri91 2 года назад

      @@moonscope1148 I have the table but ( ) and post increment has higher precedence right. So in
      (*p)++,*p++,*p++
      why evaluate *++p first rather than (*p)++

  • @Bhargav1245-g7dc
    @Bhargav1245-g7dc 3 года назад +1

    Good morning mam

  • @tmr1947
    @tmr1947 3 года назад

    mam how to start gate preparation in my 1st year. will you plz tell me tips and best online resources🙏🙏🙏

  • @SriMaheshGummaAP
    @SriMaheshGummaAP 3 года назад

    Mam, after this pointers concept please make vedios on functions concept.

    • @arjungaur1098
      @arjungaur1098 3 года назад

      vedios

    • @akashranjan7273
      @akashranjan7273 3 года назад

      @@arjungaur1098 may be autocorrect is incorrect this or may be this word from whatsapp University. but it's ok we need to understand what he said.

  • @devyanipatil6974
    @devyanipatil6974 3 года назад +1

    Mam why you are not uploading remaining videos

  • @Bhargav1245-g7dc
    @Bhargav1245-g7dc 3 года назад +1

    Happy independence day mam

    • @coding1415
      @coding1415 3 года назад

      ruclips.net/video/r2xHolThGj4/видео.html

    • @saikiranyadav9127
      @saikiranyadav9127 2 года назад +1

      JAIBHAWANISHIVAJIMAHARAJKIJAI

  • @factf_renzy
    @factf_renzy Год назад +2

    After running the last example,l am getting 10
    10 11 -1
    -1
    2
    16
    16

  • @sanasingh3184
    @sanasingh3184 3 года назад

    Mam 12 th science se karne k bad agar mai computer field mai jana cahtu hu to mare liye bca ya bsc in cs acha rhega,
    Kounsa course lane chahiye .
    Please help mam 🙏

  • @anmolmady1923
    @anmolmady1923 Год назад

    Mam you are so cute ❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️❣️

  • @cleverarrrrrrrrrno9313
    @cleverarrrrrrrrrno9313 Год назад

    Why I got -2 for the last statement but it shows 32766 or 32733 on my screen? Could someone plz explain to me

  • @innovativethinker797
    @innovativethinker797 3 года назад

    Mam please make video on how to print alphabet x or b in the pattern form Using * symbol in c language

    • @farzanaashraf8136
      @farzanaashraf8136 2 года назад

      There are many videos of mam available on the channel "patterns in c" .

  • @PavanKumar-ys2lo
    @PavanKumar-ys2lo 3 года назад

    When u will start the daa playlist Madam

  • @ajaypratapsingh8122
    @ajaypratapsingh8122 3 года назад +1

    Can anyone please tell me which book is best for C language.

    • @Shanya568
      @Shanya568 3 года назад +1

      Let Us C (17th Edition) Go for it

    • @yeruvavanachinnapareddy07
      @yeruvavanachinnapareddy07 Год назад

      @@Shanya568 jennys lectures are more than enough if u watch all classes properly