C Array Questions and Answers

Take Exam

Arrays in C language form the foundation of data storage and manipulation. They store multiple values of the same type under a single variable name, allowing efficient data handling. Programming questions and answers related to arrays frequently appear in campus placement exams and coding interviews by TCS, Wipro, and Capgemini. This topic includes C array questions with answers covering array declaration, initialization, multidimensional arrays, and pointer relations. Practicing these problems will enhance your understanding of indexing, memory usage, and algorithm design for real-world applications.

C Array

Showing 10 of 108 questions

1. Array is of

  • scalar type
  • aggregate type
  • union type
  • enumerated type
Show Answer Report

2. Array name is a

  • variable
  • pointer to constant
  • constant pointer
  • constant
Show Answer Report

3. The only operatr that can act on the arrray as a whole is

  • indirection operator
  • sizeof operator
  • { }
  • [ ]
Show Answer Report

4. Which of the following is true about array?

  • Array elements are stored in contiguous memory locations
  • In c arrays are stored in row-major order
  • An array can be declared as local as well as global
  • All the above
Show Answer Report

5. Identify the true statement

  • memory allocated by an array can be deallocated using free () function
  • C also supports zero length array
  • array can be used to hold dissimilar kinds of data
  • working beyond array size is not risky
Show Answer Report

6. Fnd the output 'void main ( ) { char a[4]="rama"; char b[ ] ="shyama"; printf{"%d %d", sizeof (a), sizeof (b)); }

  • 4 7
  • 5 6
  • 5 7
  • 4 6
Show Answer Report

7. Find the output void main () { char a[ ] ="rama"; har b [ ]=a; printf("%d %s", sizeof (b), b); }

  • 5 rama
  • 4 rama
  • 5 r
  • Compilation error
Show Answer Report

8. Find the output void main() { int a[ ] ={'a'a, 'b', 'c'}; printf("%d", sizeof (a)); }

  • 3
  • 4
  • Can't be initialized
  • None of these
Show Answer Report

9. It is said that the arrray uses "zero-basee addressing"because

  • Array size must be an integer greater than zero
  • The array subscript must always start at zero.
  • Array declaration reserves memory during compilation
  • None of these
Show Answer Report

10. Which is the about array ?

  • Array can be dynamic
  • Using malloc, memory an be allocated for array during run time
  • Unused memory can't be used at the time of requirement
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test