Loading, please wait...

C Programming Array's Multiple Choice Questions And Answers

Search here for MCQs

Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:

List of Programming Full Forms 

6. Predict the output of below code:

#include‹stdio.h› 
int main() 
{ 
    struct site 
    { 
        char name[] = "GeeksforGeeks"; 
        int no_of_pages = 200; 
    }; 
    struct site *ptr; 
    printf("%d",ptr->no_of_pages); 
    printf("%s",ptr->name);  
    getchar(); 
    return 0; 
} 
  • GeeksforGeeks
  • Compilation Error
  • Runtime Error
  • Geeks

7. Size of the array need not be specified, when

  • It is a declaratrion
  • Initialization is a part of definition
  • It is a formal parameter
  • All the above

8. The maximum number of dimension an array can have in C is

  • compiler dependent
  • Only 2
  • Only 3
  • Only 4

9. Comment on the below statements with respect to A and B

int *a1[8];

int *(a2[8]);
  1. Array of pointers
  2. Pointer to an array
  • a1 is A, a2 is B
  • a1 is B, a2 is A
  • a1 is A, a2 is A
  • a1 is B, a2 is B

10. Syntax of accessing the seventh element

  • a{7}
  • a(7)
  • a"7"
  • a[7]