39 39 votes Match each of the high level language statements given on the left hand side with the most natural addressing mode from those listed on the right hand side.$$\begin{array}{clcl} \text{(1)} &\text{$A[I] = B[J]$} & \qquad\text{(a)} &\text{Indirect addressing} \\ \text{(2)} &\text{while }(^*A\text{++}); & \qquad\text{(b)} & \text{Indexed addressing} \\ \text{(3)} & \text{int temp = }*x & \qquad\text{(c)} &\text{Auto increment} \\ \end{array}$$$(1, c), (2, b), (3, a)$$(1, c), (2, c), (3, b)$$(1, b), (2, c), (3, a)$$(1, a), (2, b), (3, c)$ CO & Architecture gatecse-2005 co-and-architecture addressing-modes match-the-following easy + – Kathleen 11.4k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply jatinmittal199510 commented Apr 17, 2021 i edited by jatinmittal199510 Apr 17, 2021 reply Follow flag $\text{while(*A++)}$ tempted me to try the below code examples. Note: $\text{A}$ is not an array but a pointer as $\text{A++}$ cannot be done with arrays because $\text{A++}$ is nothing but $\text{A=A+1}$ and in arrays value of $\text{A}$ is constant. But the same can be done with Pointers. #include <stdio.h> int main() { int b[] = {3,2,0,1}; int *A = b; //*A++ will be treated as *(A++) but increment of A will happen after using *A for condition check while(*A++){ printf("%d\n",*A); } return 0; } Output: 2 0 #include <stdio.h> int main() { int b[] = {3,2,0,1}; int *A = b; //value of A[0] is checked for condition and then A[0] is incremented by 1, always checking A[0] while((*A)++){ printf("%d\n",*A); } return 0; } Output: 4 5 6 7 . . . 12 12 replyShare Pranavpurkar commented Nov 28, 2022 reply Follow flag @jatinmittal199510 Sir, output of the first code will be :2,0,1. why will it not print 1? 0 0 replyShare Abhrajyoti00 commented Jan 23, 2023 reply Follow flag @Pranavpurkar This is because after *A = 0 is in while loop, it breaks out. Thus although later A++ makes it point to the 4th element (i.e. 1) it can’t print it. 0 0 replyShare Please log in or register to add a comment.
Best answer 49 49 votes $C$ is the answer. $A[i] = B[j]$; Indexed addressing while $(^*A++)$; Auto increment temp $=^*x$; Indirect addressing Arjun answered Sep 23, 2014 • edited Sep 5, 2018 by kenzou Arjun comment Share Follow See all 6 Comments 6 6 Comments reply Show 3 previous comments akash.dinkar12 commented Nov 18, 2018 reply Follow flag Cristine Priority of post-increment/decrement is higher than dereferencing operator in C... 11 11 replyShare Cristine commented Jan 12, 2019 reply Follow flag @akash.dinkar12 okay i got confused between *A++ and x=*A++ 1 1 replyShare Shiva Sagar Rao commented Dec 19, 2020 reply Follow flag Priority of post increment/decrement operator is higher than dereference operator but Priority of pre increment/decrement operator and dereference operator is same. Ref: https://en.cppreference.com/w/c/language/operator_precedence 2 2 replyShare Please log in or register to add a comment.
7 7 votes A[i] = B[j];Array indexing hai, yaani base address + index offset.Yeh typical example hai indexed addressing ka.So (1) → (b)while(*++A);Yahaan pointer A ko pre‐increment karke uski nayi location ko dereference kar rahe hain.Isse kehte hain “auto‐increment addressing,” kyunki pointer update + use ho raha hai.So (2) → (c)*int temp = x;Yahaan pointer x ko dereference karke uske andar ke address se data la rahe hain.Yeh direct example hai indirect addressing ka (pointer ke andar ke address par jaa ke access).So (3) → (a) Kshitij Sharma answered Jan 3, 2025 Kshitij Sharma comment Share Follow See 1 comment 1 1 comment reply legend_of_cse commented Aug 27 reply Follow flag I think u have taken both wrongly,plz correct it1) while(*++A);2) *int temp = x; 0 0 replyShare Please log in or register to add a comment.