1,135 views

1 Answer

0 0 votes
In an array, the memory space is allocated in a contiguous manner. Therefore if we know the address of a[i-1] then can find the address of a[i] by going forward in memory by the size of integer. Hence the answer.
Position:
Show:

Related questions

5 5 votes
2 2 answers
291
291 views
GO Classes asked Jun 29
291 views
What is the output of the following code?#include <stdio.h struct Student { int roll; int marks; }; int main() { struct Student s[3] = { {1, 70}, {2, 80}, {3, 90} }; s .m...
6 6 votes
1 1 answer
182
182 views
GO Classes asked Jun 23
182 views
What will happen when the following code is compiled?#include <stdio.h int main() { int a[] = {10, 20, 30}; a = a + 1; printf("%d", *a); return 0; }$\texttt{10}$ $\texttt...
7 7 votes
2 2 answers
222
222 views
GO Classes asked Jun 23
222 views
What is the output of the following code?#include <stdio.h int main() { int a[] = {5, 10, 15, 20}; int *p = a + 1; printf("%d %d %td", *(p + 1), p , (p + 2) - a); return ...
7 7 votes
2 2 answers
268
268 views
GO Classes asked Jun 22
268 views
What is the output of the following code?#include <stdio.h int main() { int a[] = {2, 4, 6, 8, 10}; printf("%d %d %d", *a, *(a + 3), 3[a]); return 0; }$\texttt{2 6 8}$ $\...