Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE MOCK 2017 | Question 22

Improve Article
Save Article
  • Difficulty Level : Medium
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!