C Array Questions and Answers
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
3. The only operatr that can act on the arrray as a whole is
- indirection operator
- sizeof operator
- { }
- [ ]
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
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
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
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
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
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
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