Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE MOCK 2017 | Question 22

  • Last Updated : 28 Jun, 2021

What will be the output produced by the following C code:

int main()
{
    int array[5][5];
    printf("%d",( (array == *array) && (*array == array[0]) ));
    return 0;    
}

(A) 1
(B) 0
(C) 2
(D) -1


Answer: (A)

Explanation:
Given is a 2d array array[5][5].
Suppose base address of array is 2000

array = 2000
*array = 2000

array[0] = 2000

So expression is something like 2000==2000 && 2000==2000 i.e. 1&&1 will return 1.



Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :