The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
116 views

In the above 4 Statements which would print 123 as output ? Explain also.

in Programming by (167 points)
edited by | 116 views
0
Please mention the source of question- this is not a self doubt.
0
Sir, from when the GO Hardcopy will be available again?
+1
Will be updated this week. Probably by May.
+1
a[5]=5[a]=*(a+5)

by same analogy-

a[5][5][5]=(*(*(*(a+5)+5)+5))==*(*(a+5)+5)[5]

*((*(arr+5))[5]+5)==*(arr[5][5]+5)==arr[5][5][5]

so my ans is option (i),(ii),(iii),(iv)
0
Can you tell me how the storage will be done as we are having array of 3 dimensions and no. is only 123.
0

suppose int arr[2][3][3]={0};

total number of element in array  =2*3*3

actual all element of array are stored in row major order by default in contiguous manner -

1-

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

               

                                     OR

2-

0 0 0
0 0 0
0 0 0

 

0 0 0
0 0 0
0 0

0

 

second is good for understanding

now i want to access the element in the 1st row 3rd coloum of 1st 2-d array ==arr[0][0][2]

 

0
Thank you so much.
0

I think all 4 statements are same.

@sandeep singh gaur

0
i also think verify my ans i edited

Please log in or register to answer this question.

Related questions

+6 votes
3 answers
1
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,376 questions
55,840 answers
192,571 comments
91,400 users