Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Arrays | Question 1

  • Difficulty Level : Easy
  • Last Updated : 10 Jan, 2013

Predict the output of below program:

Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.

#include <stdio.h>
int main()
    int arr[5];
    // Assume that base address of arr is 2000 and size of integer
        // is 32 bit
    printf("%u", arr);
    return 0;

(A) 2002
(B) 2004
(C) 2020
(D) lvalue required

Answer: (D)

Explanation: Array name in C is implemented by a constant pointer. It is not possible to apply increment and decrement on constant types.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!