0 votes 0 votes Suppose the following declarations are in effect : $\text{int }a[ \: ] = \{5,15,34,54,14,2,52,72 \}$; $\text{int }*p = \&a[1] , *q = \&a[5]$; The value of $q - p$ is ________. Programming in C tbb-programming-2 numerical-answers + – Bikram asked May 14, 2017 edited Aug 19, 2019 by Counsellor Bikram 377 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes sir, here value of q-p should be 4.. if the value of *q - *p had been asked then it should be -13 joshi_nitish answered May 20, 2017 selected Aug 1, 2017 by Bikram joshi_nitish comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments Bikram commented Jun 12, 2017 reply Follow Share @jai q is a pointer, it store memory address of 6th element with value 2 with index 5 . p is another pointer, it store memory address of 2nd element with index 1 whose value is 15. so value for q is 5 and value for p is 1 so q-p is = 5-1 = 4 1 votes 1 votes Anuranjan Chauhan commented Aug 1, 2017 reply Follow Share that is exactly my question 0 votes 0 votes Bikram commented Aug 1, 2017 reply Follow Share @ Anuranjan here we considering the index position of p and q . 0 votes 0 votes Please log in or register to add a comment.