Thanks alot mum. d = p - q = - 4; *q = 25; (means the value at the address of &a[4] which was 11 is now 25); d = q - p = 4; *p = 27; means the value at the address of &a[0] is now 27; q = q - 3 = (1016 - 3*4) = (1016 - 12) = 1004; p = p + 3 = (1000+ 3*4) = (1000 + 12) = 1012; d = p - q = (1012 - 1004) = (8/4) = 2; You are a genius mum.
@bhaskarverma89432 жыл бұрын
d=-4 *q=25 now (11 is replaced with 25) d=4 *p=27 now(50 is replaced with 27) q=q - 3 (1004) p=p +3 (1012) d=2
@anjalichawla77102 жыл бұрын
🤩🤩
@anshumanbisht62412 жыл бұрын
ans of last part will be -4
@hasanmahmud45432 жыл бұрын
@@anshumanbisht6241 you sure?
@biniyamfisseha10962 жыл бұрын
@@anshumanbisht6241 he is right d = 2 because the new value of p is 1012 and q is 1004. so (1012 - 1004)/4(int) = 8/4 which is 2.
@mdsharique23862 жыл бұрын
d will be - 2 p=p+3 = 1000+3=1003 q=q-3 =1016-3 = 1013 p-q = 1003-1013 = -10/4=-2
@yunusabdul1652 Жыл бұрын
Happy teacher's day ❤❤My best cs teacher 🎉
@maryannemuthoni538811 ай бұрын
1). d - q = -4 2). *q = 25; a[4] is now 25 The array now looks like {50, 1, -1, 10, 25} 3). d = q-p 4 4). *p = 27 The first value, a[0] is now 27 The array now looks like {27, 1, -1, 10, 25} 5). q = q-3 1016 - 12 = 1004 q now points to second value q[1] 6). p = p + 3; 1000 + 12 = 1012 p now points to p[3] 7). d = p - q 1012 - 1004 = 8/4 Separated by 2 elements
@Vitalraj1873 жыл бұрын
The way of your talking and communication are super mam tq for your videos
@bodeddulapragathi2184Ай бұрын
Very glad to see your videos. Getting interest to learn coding only bcz of you Mam. Thanks for the amazing videos and your explaination is peaks
@sonalikawadibhasme87543 жыл бұрын
Ma'am tussi great ho🙇♀️
@yashhokte10203 жыл бұрын
Here is the answers of the questions : 1) d = -4 , now after *q=25 it will stored in the a[4] then d = 4 and after *p = 27 it will stored in the a[0] then after q = q-3 the value will be 1 and after p=p-q the value will be 10 and at last after d = p-q here d will be 2.. Thnku so much mam😊
@741ibrahim23 жыл бұрын
our institutions should learn from her ki aise phadate hai !!!!!!!!!!!!!1
@yashhokte10203 жыл бұрын
@@741ibrahim2 same.. She deserves more better than what she had now
@palakrai462 жыл бұрын
No.... d=p-q will be -1 Because of 1000-1004=-4 And, then divide -4by 4 then the answer will be -1.
@madhavahuja35902 жыл бұрын
@@palakrai46 no your answer is incorrect i think.
@hasanmahmud45432 жыл бұрын
@@palakrai46 q is pointing to a[4] pls check it.
@megh50132 жыл бұрын
Thanks a lot Mam for this lecture!!!
@praveensamuel80833 жыл бұрын
1) d=p-q -4. 2) *q=25; value is assigned to @address 1016 means 11 is replaced with 25 y bcoz we are using assignment operator (=). 3) d=q-p ans=4. 4) 27 is assigned@address value of 1000. 5) q=q-3 ans. @address 1004 value is 1... 6) p=p+3 ans. @address 1012 value is 10 correct me if I'm wrong... #EEE student .. lots of love from Telangana state mam💙 Note: p-q results will give us as a integer value... by dividing size of data type and p-2 results will give us as a address value
@tamilelakkiyathennarasu9713 жыл бұрын
d=p-q is 4 is it correct
@praveensamuel80833 жыл бұрын
@@tamilelakkiyathennarasu971 ...wrong correct and is -4
@souviknandi57923 жыл бұрын
@@praveensamuel8083 yes..
@souviknandi57923 жыл бұрын
3) d=q-p ans=4...vaiya can you plz describe this line for me...plz!!!
@souviknandi57923 жыл бұрын
ans. @address 1004 value is 1.. I Think It Is (-1)....for q=q-3.
@bawaabdulsilas3681 Жыл бұрын
In the first line d = p - q; p is pointing to 1000 and q to 1004 Therefore d = (p - q)/4; d = (1000 - 1004)/4; d = -4/4; ultimately d = -1. The second line dereference q by reassigning its value to 25, so therefore, the value at address q now stores 25. The third line d = q - p; Note that the values of addresses of p and q hasn't changed yet, Therefore d = (q - p)/4; d = (1004 - 1000)/4; d = 4/4; so ultimately d = 1. The fourth line *p = 27, reassigned the value of the address pointed to by p to 27. The fifth line q = q - 3, can be evaluated as follows Note also that p and q are still pointing to the same address as above. q = q - (3 * 4); q = 1004 - 12; therefore q = 992; meaning that q is now pointing to address [992] if any, and that too on the left hand side of p. Line six gives p = p + 3; As usual p = p + 3; p = 1000 + (3 * 4); p = 1000 + 12; p = 1012; this means that p now points to this address [1012] in the memory. And finally on line 7, d = p - q; Now note that the address of p and q have both changed p points to 1012 and q to 992 (if is a valid address) Therefore, d = (p - q)/4; d = (1012 - 992)/4; d = 20/4; d = 5.
@goplay5936 Жыл бұрын
q is pointing to 1016
@bawaabdulsilas3681 Жыл бұрын
@@goplay5936 We have many instances of q, so state your case clearly please. At what stage is q = 1016?
@simon-gh1pt Жыл бұрын
@@bawaabdulsilas3681 at first
@mehendidesigns93453 жыл бұрын
Mam pls make video on dynamic memory allocation after pointer
@shraddhapawar56743 жыл бұрын
Just go through Maam dsa lec, you will get concept
@ashwani80143 жыл бұрын
Pahle mai bahut garib hua karta tha fir ek dost ne mughe dream 11 ke bare me bataya ab main gareeb Ke sath sath kargdaar v hu
@techcode_world9 ай бұрын
mam but we can add like *p=*p+*q int a=2; int *p=&a; int *q=&a; *p=*p+*q; printf("%d",*p); output: 4
@dreypraydev Жыл бұрын
These are the results for the 7 mini exercises so you can verify yourself, guys. 1. d = -4; 2. *q = 25 => a[4] = 25; 3. d = 4; 4. *p = 27 => a[0] = 27; 5. q = 1004; 6. p = 1012; 7. d = 2;
@SunilYadav-nb9wp3 жыл бұрын
Why we use pointer ?
@etceterafans23453 жыл бұрын
11:08 you said the expression p=p-1 gives you a garbage value. but i run that it gives answer like previous one's. whatever we get while q pointer, also i got in p pointer. in subtraction we just find difference between address of value stored. if suppose we use d=*q-*p we can get subtraction of value stored there. so on that expression we can't get p=p-1 value. there we will get garbage value
Why we are not able to add two pointer where as we can substract two pointer?
@piyushjoshi46187 ай бұрын
Because adding 2 pointers will result in a very large value
@ghanatheaarthi66733 жыл бұрын
Mam after completing c pls do c++ also
@adrikamukherjee5607Ай бұрын
Ma'am where do you live? Do you provide any live coaching classes offline or online? Please let us know
@shivarajgugri1132 жыл бұрын
d=(p-q)/bytes. Or d=(p-q)/bits Plz reply me mam
@nehanthv42382 жыл бұрын
It's d=(p-q)/.Size of an integer datatype is 4 bytes...So, its bytes
@qemmm11 Жыл бұрын
Thanks!🫡
@theenglishspeaker8272 жыл бұрын
Mam but Where we use pointer arithmetic?
@endlessloopsoftwares47243 жыл бұрын
Me who is here just to see that smile which is my motivation....
@MaheshKumar-jz9mr3 жыл бұрын
Mam u r so cute😁😍🤭
@himanshu-x8s6b2 ай бұрын
thank you mam ji
@kushchauhan41163 жыл бұрын
in pointer variable int. submit ho jati hai..
@missankitabose17833 жыл бұрын
d^p-q; Output :4 Thn *q^25; d=q-p; Output : 4 *p^27; q^q-3; p^p+3; d^p-q; Output ^2 Ma'am please tell me is my answer right or not?
@praveensamuel80833 жыл бұрын
first one ans is negative value it's -4
@missankitabose17833 жыл бұрын
Yeah as it is p-q ...
@souviknandi57923 жыл бұрын
@@praveensamuel8083 yes...
@SwetaKumari-ps2rf3 жыл бұрын
@@praveensamuel8083 yes ur right
@palakrai462 жыл бұрын
Wrong first one is -1.
@tejhimanshu2 жыл бұрын
At 17:38, q-p= -1, how?
@bhagyashrijadhav11582 жыл бұрын
Because, *q=4 and *p=3 Suppose we consider, Addresses like 1000, 1004, 1008, 1012, 1016 to the values. Then the address of q is 1004 and address of p is 1008. q-p = 1004 - 1008 = -4/4 = -1.
@tejhimanshu2 жыл бұрын
@@bhagyashrijadhav1158 got it Thanks
@sadabshiper75972 жыл бұрын
int a[] = {50, 1, -1, 10, 11}; int *p = &a[0]; int *q = &a[4]; statement - 1: d = p - q; or, d = -4 statement - 2: *q = 25; so value of a[4] will be replaced by 25, ie a[4] = 25 so new array would become : a[] = {50, 1, -1, 25, 11}; statement - 3: d = q - p; or, d = 4 statement - 4: *p = 27; so value of a[0] will be replaced by 27, i.e. a[0] = 27 so new array would become : a[] = {27, 1, -1, 25, 11}; statement - 5: q = q - 3; This means index of q will be moved left by 3 positions. So *q will point from q[4] to q[1] that is *q = a[1] = 1 statement - 6: p = p + 3; This means index of p will be moved right by 3 positions. So *p will point from p[0] to p[3] that is *p = a[3] = 25; statement - 7: d = p - q; or, d = 3 - 1 or, d = 2
@aswathkumar182 жыл бұрын
13:14 For statement- 2, I think the array will be like a[ ] ={ 50,1,-1,10,25} Correct me if I'm wrong!
@Bhabukrijal3 жыл бұрын
नमस्ते । म हजुकाे भिडीयाे नियमित हेर्छु । म सुर्खेत नेपालबामट हेरिरयकाे छु।।
@GauravThakur-hz3zi Жыл бұрын
Is Ans of d is 8???
@gd2854 Жыл бұрын
Zebra ma'am ❤
@motemontero55923 жыл бұрын
Madam please 🙏please 🙏 🙏 we need GTK for c programming
@Samarora062 жыл бұрын
I enjoy the study when all teachers look like u
@rishavchowdhury59543 жыл бұрын
Everybody here is to tell her that how cute she is. So indian!
@shashank_kishore_2 ай бұрын
❤❤❤❤❤❤❤❤❤❤❤❤❤
@rajasekhar8848 Жыл бұрын
madam c language bahubali anukunara...prati topic ki part1,part 2 ani chestune poyaru. for the first time bahubali movie kuda short film la anipichindi me vedeos mundu...any ways tq for good explanation.😭
@vigneshwaran_20023 жыл бұрын
Mam c++ pointers videos upload please
@BTCIV_AyushMalviya2 жыл бұрын
Thankyou Mam
@williemungai19542 жыл бұрын
d=3; *q = 25/*25 replaces the value 11 in a[4]*/ d = 4; *p = 27/*27 replaces the value 0 in a[0]*/ q = now stores &a[1]; p = now stores & a[3]; d = 4;
@user-no5ns8wp4t2 жыл бұрын
Thx
@SravanKumar-uc6qt3 жыл бұрын
Looking so Grosgeuss madam zi
@YOUTUBECOMMENTER...3 жыл бұрын
Jenny's so pretty 😍
@nandinil8723 Жыл бұрын
Can any one please explain at 15:25.......how q-p=3 and p-q=-3
@deepikapampanaboyina2 ай бұрын
Here is the answer q has address 1000a and q has a address 1012 when subsract the two different pointers we have to divide by size of data type that means p-q/size of data type =1000-1012/4=3
@itzharivlog2733 жыл бұрын
Python ka bhi video banaoo
@orsusaikumari63023 жыл бұрын
I love u mam
@rapakalokesh8449 Жыл бұрын
take care maam 😉😉
@aasanhai186 ай бұрын
d=-4 p=1012 q=1004
@coding_with_bf Жыл бұрын
Mam index is starting from 0 ,when we move on to backward of the index of 0 . What will be there? -1 or anything 😢
@ABIRAJP-dm1di Жыл бұрын
some garbage value of other address
@coding_with_bf Жыл бұрын
@@ABIRAJP-dm1di thank you
@amitparmar45673 жыл бұрын
Ap bahot beautiful hoo, Love u ❤
@shyamsuratyadav6553 жыл бұрын
First one to comment
@_getrichnow2 жыл бұрын
d will be 2
@milenazafirova77542 жыл бұрын
//Subtraction of pointers; Homework: #include int main() { int i; int d; int a[] = { 50, 1, -1, 10, 11}; int *p = &a[0]; int *q = &a[4]; printf("\tSubtraction of pointers. Homework: "); printf(" "); printf("address of p: %u ", p); printf("address of q: %u ", q); printf(" "); d = p - q; printf("Difference is: %d ", d); *q = 25; printf("Array a: "); for(i = 0; i < 5; i++) { printf("%d\t", a[i]); } printf(" "); printf("Updated value of q is: %d ", *q); printf(" "); d = q - p; printf("Updated difference is: %d ", d); printf(" "); *p = 27; printf("Updated array a: "); for(i = 0; i < 5; i++) { printf("%d\t", a[i]); } printf(" "); printf(" "); q = q - 3; printf("Updated address of q is: %u ", q); printf("Updated value of q: %d ", *q); printf(" "); p = p + 3; printf("Updated address of p is: %u ", p); printf("Updated value of p: %d ", *p); printf(" "); d = p - q; printf("Difference between p and q is: %d ", d); printf(" "); printf("Elements of array a after subtraction: "); for(i = 0; i < 5; i++) { printf("%d\t", a[i]); } printf(" "); } OUTPUT: Subtraction of pointers. Homework: address of p: 924154144 address of q: 924154160 Difference is: -4 Array a: 50 1 -1 10 25 Updated value of q is: 25 Updated difference is: 4 Updated array a: 27 1 -1 10 25 Updated address of q is: 924154148 Updated value of q: 1 Updated address of p is: 924154156 Updated value of p: 10 Difference between p and q is: 2 Elements of array a after subtraction: 27 1 -1 10 25 💙
@skmannan64952 ай бұрын
Pyu😂😅😅😅
@akhilsugaraju39052 жыл бұрын
Can any one explain in addition we can't do P1+P2 But in subtraction how can we do p2-p2 or p1-p2.explain pls.
@Vitalraj1873 жыл бұрын
Hai mam😍
@anushajade3791 Жыл бұрын
Mam changed the marker😂
@DeepanshuKumar-zu4gvАй бұрын
In last answer is 0
@amitparmar45673 жыл бұрын
Love u
@abhishekkumarjha43143 жыл бұрын
❤️❤️❤️❤️❤️.
@pradeeprao24733 жыл бұрын
❤️👍
@TheChemistryTeacher3 жыл бұрын
Being a jee aspirant just Watching...That what's going on the whiteboard....??
@gouravsonu22962 жыл бұрын
Answer is -4 11 will be replaced by 25 4 50 will be replaced by 27 Again 25 will be replaced by 1 Again 50 will be replaced by 10 2 Thanks 🙏
@ragnarlothbrok3672 жыл бұрын
Some random indian girl > my entire career
@durgeshkushwaha25343 жыл бұрын
Mam, please Hindi me padhaeye 🙏🙏
@ankanroy47183 жыл бұрын
ম্যাডাম vidyasagar University-র 3rd semister-এর exam online হবে না offline-এহবে।