Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Test  >  Programming and Data Structures  >  Test: Arrays - 1 - Computer Science Engineering (CSE) MCQ

Arrays - 1 - Free MCQ Practice Test with solutions, GATE CSE (CSE) Programming


MCQ Practice Test & Solutions: Test: Arrays - 1 (10 Questions)

You can prepare effectively for Computer Science Engineering (CSE) Programming and Data Structures with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Arrays - 1". These 10 questions have been designed by the experts with the latest curriculum of Computer Science Engineering (CSE) 2026, to help you master the concept.

Test Highlights:

  • - Format: Multiple Choice Questions (MCQ)
  • - Duration: 30 minutes
  • - Number of Questions: 10

Sign up on EduRev for free to attempt this test and track your preparation progress.

Test: Arrays - 1 - Question 1

How do you initialize an array in C?

Detailed Solution: Question 1

This is the syntax to initialize an array in C.

Test: Arrays - 1 - Question 2

Which of the following is the correct way to declare a multidimensional array in Java?

Detailed Solution: Question 2

The syntax to declare multidimensional array in java is either int[][] arr; or int arr[][];

Test: Arrays - 1 - Question 3

LB are UB are lower bound and upper bound of a linear array LA. Consider following algorithm -

  1. Repeat for K = LB to UB apply PROCESS to LA [K]
  2. Exit

The algorithm ______ the array LA.

Detailed Solution: Question 3

LB refers to the lower bound of an array ( first index element of an array ) and UB refers to the upper bound of an array, that is the last index of an array. 

Let's take an example to understand this - 
Array - [2,6,7,0,15], where 2 is the lower bound and 15 is the upper bound element.

The K is the variable that holds the index of the array. While the LA is the name of the array. A loop is used to visit to traverse the elements from LB to UB.

The K holds the index of element 2 which is 0 and reaches index 4 of element 15.

The LA array using K traverse all the elements in the array. So, Option 2 will be the answer. 

Test: Arrays - 1 - Question 4

In C, how do you properly initialise an array?

Detailed Solution: Question 4

Array:
An array is a group of data components that are stored in the same memory region at the same time. It is the most basic data structure, in which each data piece may be retrieved simply by its index number alone.

Array initialize:
Only square brackets [ ] must be used for declaring an array. The given {}, () are not useful for array initialization.
int arr[5]={11,12,15,16,19} is correct.
The above statement can store the 5 elements in a continuous manner. consider the array base address is 100.

Hence the correct answer is  int arr[5]={11,12,15,16,19}.

Test: Arrays - 1 - Question 5

What is the output of the following Java code?

public class array
{
    public static void main(String args[])
    {
        int []arr = {1,2,3,4,5};
        System.out.println(arr[5]);
    }
}

Detailed Solution: Question 5

Trying to access an element beyond the limits of an array gives ArrayIndexOutOfBoundsException.

Test: Arrays - 1 - Question 6

Which of the following concepts make extensive use of arrays?

Detailed Solution: Question 6

 Whenever a particular memory location is referred to, it is likely that the locations nearby are also referred, arrays are stored as contiguous blocks in memory, so if you want to access array elements, spatial locality makes it to access quickly.

Test: Arrays - 1 - Question 7

Consider the following array declaration in ‘C’ language:

int array[] = {2, 3, 4, 5};

What will be the output of the following statement?

printf("%d", array[2]);

Detailed Solution: Question 7

An array is defined as the collection of similar types of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc. C array is beneficial if you have to store similar elements.

int array[] = {2, 3, 4, 5}; This array storage be like, 

The above array at index I can be accessed by, a[i], i[a], *(a+i) or *(i+a) all the above representations all are equal and gives the i th index value.

printf(%d', 2[array]); So, it gives the 2nd  index value. i.e 4.

Hence the correct answer is 4.

Test: Arrays - 1 - Question 8

Consider the following declaration of an array in ‘C’ language:

int A[6] = {1, 2, 3, 5};

Which of the following statements is true?

Detailed Solution: Question 8

Array name: A

To access 3rd element in an array A[2] or 2[A] is used.  Therefore Both A[2] and 2[A] represent the value 3

Test: Arrays - 1 - Question 9

What are the disadvantages of arrays?

Detailed Solution: Question 9

Arrays are of fixed size. If we insert elements less than the allocated size, unoccupied positions can’t be used again. Wastage will occur in memory.

Test: Arrays - 1 - Question 10

Find the number of elements in the following array.

char si [] = "India is great";

Detailed Solution: Question 10

char si [] = "India is great";

The above declaration is a dynamic allocation of array name si of character datatype.

Hence the correct answer is 15.

161 docs|30 tests
Information about Test: Arrays - 1 Page
In this test you can find the Exam questions for Test: Arrays - 1 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Arrays - 1, EduRev gives you an ample number of Online tests for practice
Download as PDF