Aspire Faculty ID #18508 · Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II) · Just now
UGC NET Computer Science Dec 2022 Shift I (Paper II)

Given

int arr[3][4][2] =
{
  {{2,4},{7,8},{3,4},{5,6}},
  {{7,6},{3,4},{5,3},{2,3}},
  {{8,9},{7,2},{3,4},{5,1}}
};

Which one of the following can be used to refer to element 1 in the above 3-d array?

Solution

In C language, array indexing starts from $0$.

The element $1$ is present at:

$arr[2][3][1]$

Now,

$arr+2$ points to the third $2$-D block.

$*(arr+2)$ gives $arr[2]$.

$*(arr+2)+3$ points to $arr[2][3]$.

$*(*(arr+2)+3)$ gives $arr[2][3]$.

$*(*(arr+2)+3)+1$ points to $arr[2][3][1]$.

Therefore,

$*(*(*(arr+2)+3)+1)=arr[2][3][1]=1$

Previous 10 Questions — UGC NET Computer Science Dec 2022 Shift I (Paper II)

Nearest first

Next 10 Questions — UGC NET Computer Science Dec 2022 Shift I (Paper II)

Ascending by ID
1
Allowing different derived classes to be used interchangeably through the interface provided by a common base class is …
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
2
In _____ curve the last and the first vertices of the polygon lie on the curve and all other vertices define the deriva…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
3
A _____ operation combines the rows of the two relations and outputs a new relation that has both input relations' rows…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
4
Consider the relation $R(P,Q,R,S,T,U,V,W,X,Y)$ and FDs: ${P,Q,S}\to T$ $R\to Y$ ${P,Q}\to V$ ${R,X}\to X$ $Q\to U$ $V\t…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
5
Which RAID level is appropriate for storing the log file of a ticket booking system where a huge database update is req…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
6
If we convert a decision tree to a set of logical rules, then:
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
7
Model of protection can be viewed as
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
8
Process in memory also contain the heap section. What is the use of heap section?
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
9
How many page faults occur for optimal algorithm for the following reference string, with four frames?$1,2,3,4,5,3,4,1,…
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
10
Degree of concurrency in thread can be arranged in the manner.
Topic: UGC NET Computer Science Dec 2022 Shift I (Paper II)
Ask Your Question or Put Your Review.

loading...