Open In App
Related Articles

C | Arrays | Question 1

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
Predict the output of below program:
#include <stdio.h>
  
int main()
{
    int arr[5];
      
    // Assume that base address of arr is 2000 and size of integer
        // is 32 bit
    arr++;
    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.

Last Updated : 10 Jan, 2013
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads