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
61. In case of a strictly lower triangular array which of the following is true.
- All the elements above diagonal element are zero.
- All the elements lower diagonal element and also the diagonal elements are zero.
- All the elements above diagonal element and also the diagonal elements are zero.
- All the elements lower diagonal elements are zero.
62. The total numberr of of non-zero elements in a lower triangular arrays with n rows is
- n
- (n+1) /2
- n(n+1)/2
- n+a
63. Which of the following declarations for a two dimentional integer type array called matrix for 3 rows and 5 columns ?
- int matrix [3] [5];
- int matrix [3, 5];
- int matrix [1+2] [2+3]
- Both a and c
64. Find the output void main ( ) { int a[2, 3] ={ (2, 3), (4, 5), (6, 7)}; printf("%d", a[0]); }
- 2 3
- Address of the array
- 2
- Compilation Error
65. Find the output void main ( ) { int arr[2]={(1, 2), (2, 3)}; printf("%d", sizeof (arr+1)); }
- 4
- Compilation error
- 8
- 2
66. which is the wrong one about array from the following ?
- sizeof () operator doesn't report the size of an array which is parameter to a function.
- Arrays are just constantj pointers.
- int a[20] is declaration cum definition.
- Memory allocation is static for an array.
67. Which of the following array initialization is not possible ?
- int 5[int]={1, 2, 3, 4, 5 };
- int a[5]={1, 2, 3, 4, 5};
- float a[ ]={'a','b','c','d','e'};
- int b[ ]={1, 2};
68. What will be the adjacent element of a [0][1] in the array a[2][2].
- a [0] [1]
- a [0] [0], a[1] [0], a[1] [1]
- a[0] [0], a[1] [1]
- a [0] [0], a[0] [1]
69. Array is which kind of data type.
- Fundamental data type.
- User-defined data type.
- Derived data type.
- It's not a data type
70. Choose the wrong one out of the following.
- int array [15]; Here array is not a valid identifier.
- All arrays except character array can not be read/displayed as a single entity, but the individual elements are read/displayed.
- the base address of an array is the address of the zeroth element (stanrting element)
- char str[20]; declares character array str having a maximum of 20 characters