Home Tuitions

CUET CS Chapter-Arrays 

Board CBSE
Textbook NCERT
Class Class 12
Subject Computer Science
Chapter CUET CS Chapter-Arrays 
Chapter Name Arrays
Category CUET (Common University Entrance Test) UG

MCQ-Based Questions for CUET Computer Science Chapter-Arrays 

This page is prepared by HT experts and consists of MCQ-Based Questions for CUET Computer Science chapter-Arrays with a detailed explanation of all the questions asked from Arrays. To find the solution to the MCQ questions click on the answer tab. Check out chapter-wise CUET computer science Practice MCQ Based Questions. 

Practice Questions for CUET Computer Science chapter-Arrays SET-1

Computer Science - MCQ on Arrays

Class XII

Q.1 The errors in the code below is

#include<iostream.h>

void main()

{

char c[]=”c++ is easy”;

int i = strlen (c) ;

cout<< i ;

}

a) no error.

b) c cannot be passed as an argument. It should be c[].

c) string.h header file is not defined.

d) no return statement for main ().

Answer:

(c)

Explanation: “string.h” header file has defined string functions in it like strlen, strcpy. These functions cannot be used without using string.h header file.

Q.2 The errors in the code below is

#include<iostream.h>

const int i =10;

void main()

{

const int i =20;

cout<< &i << &::i ;

}

a) compiler error : illegal structure declaration.

b) no error.

c) :: cannot be used with constant.

d) Run-time error.

Answer:

(a)

Explanation: &::I is an illegal declaration used in the code.

Q.3 The value which can be assigned to char names[6] is

a) aditi.

b) priyanka.

c) amrita.

d) mudita.

Answer:

(a)

Explanation: One space is needed for null character, which acts as a termination symbol.

Q.4 The code “int marks [30]” used in one of the C++ program is

a) not an array.

b) single dimensional array.

c) multi dimensional array.

d) two dimensional array.

Answer:

(b)

Explanation: The syntax of single dimension array is “datatype arrayname[size]” whereas multi dimension arrays are accessed using more than one index. Example names[][]. It can be 2 dimensional or 3 dimensional.

Q.5 A character array is also known as

a) character string.

b) array.

c) integer.

d) character.

Answer:

(a)

Explanation: A string of characters is stored in successive elements of a character array. A character array is also known as character string.

Q.6 The data type of an array is known as

a) constant.

b) floating point variable of the array.

c) variable

d) base type of the array.

Answer:

(d)

Explanation: An array is a data structure consisting of a group of elements that are accessed by indexing. Each element of an array has the same data type and the array occupies a contiguous area of storage.

Q.7 The examples of compound data structures are

a) arrays.

b) structures.

c) stacks and queues.

d) arrays and structures.

Answer:

c)

Explanation: Simple data structures can be combined in various ways to form more complex structures called compound data structures.

Q.8 The examples of simple data structures are

a) stacks.

b) queues.

c) linked list.

d) arrays.

Answer:

(d)

Explanation: These data structures are normally built from primitive data types like integers, real, characters, boolean.

Q.9 The code int marks [20] has

a) 0 to 20 subscripts

b) 0 to 19 subscripts

c) 1 to 20 subscripts

d) 1 to 19 subscripts

Answer:

a)

Explanation: This is because the last element of an array is a null character ‘\0’.

Q.10 The total number of elements in the array int x[5] [6] is

a) 5 elements.

b) 29 elements.

c) 30 elements.

d) 11 elements.

Answer:

c)

Explanation: The total number of elements in an array [a][b] is a x b. Here 5 x 6 =30.

Q.11 A named group of data which share similar properties or characteristics and have common behaviour among them is called

a) data item.

b) data type.

c) raw data.

d) information.

Answer:

(b)

Explanation: Data can be of different types. It can be numeric, alphabetic, or alphanumeric.

Q.12 The example of a non-linear data structure is

a) stacks.

b) queues.

c) linked list.

d) trees.

Answer:

(d)

Explanation: Non-linear data structures are multilevel data structures and tree is one of them.

Q.13 A way of modeling real-life data in a specific context is

a) application (or user) level of data structure.

b) abstract (or logical) level of data structure.

c) implementation level of data structure.

d) the only way of designing data structure.

Answer:

a)

Explanation: The data structure can be designed from user level perspective.

Q.14 An abstract collection of elements and its corresponding set of accessing operations is

a) application (or user) level of data structure.

b) logical level of data structure.

c) implementation level of data structure.

d) the only way of designing data structure.

Answer:

(b)

Explanation: Abstract level of data structure is same as logical level.

Q.15 A specific representation of the structure and its accessing operations in a programming language is

a) application (or user) level of data structure.

b) logical level of data structure.

c) implementation level of data structure.

d) the only way of designing data structure.

Answer:

c)

Explanation: There are different perspectives while designing a data structure. The implementation requires writing a set of procedures that create and manipulate instances of that structure.

Q.16 The examples of primitive data types are

a) arrays.

b) structures.

c) int, float, double.

d) class.

Answer:

c)

Explanation: Primitive data types are fundamental or standard data types, such as integer, real or character data types.

Q.17 The examples of non–primitive data types are

a) int.

b) float.

c) double.

d) union, structures.

Answer:

(d)

Explanation: The data types which are composed of primitive data types such as, int, real, character are non-primitive data types.

Q.18 User defined data types is another name for

a) primitive data types.

b) non-primitive data types.

c) fundamental data types.

d) standard data types.

Answer:

(b)

Explanation: Non-primitive data types are defined by the users. That is why, they are sometimes called user defined data types.

Q.19 In array initialization, the size of

a) last dimension can be skipped.

b) mid dimension can be skipped.

c) first dimension can be skipped.

d) any dimension cannot be skipped.

Answer:

c)

Explanation: We do not need to initialize all elements in an array. If an array is partially initialized, elements that are not initialized receive the value 0 of the appropriate type.

Q.20 An array of automatic storage duration whose length is determined at run time is called

a) static array.

b) variable length array.

c) dynamic array.

d) fixed size array.

Answer:

(b)

Explanation: These arrays are considered complete types, but can only be used in declarations of function prototype scope.

Q.21 A variable length array

a) can be initialized.

b) may or may not be initialized.

c) cannot be initialized.

d) should always be initialized.

Answer:

c)

Explanation: Since its length is determined at run time, so it cannot be initialized.

Q.22 Individual objects in an array are called its

a) elements.

b) data types.

c) indexes.

d) classes.

Answer:

a)

Explanation: An array is a collection of objects of the same data type, allocated contiguously in memory. Individual objects in an array, called elements, are accessed by their position in the array.

Q.23 A dynamic array is same as

a) static array.

b) fixed size array.

c) resizable array.

d) dynamically-allocated array.

Answer:

c)

Explanation: A dynamic array can be resized and it allows elements to be added or removed.

Q.24 The data type of an array is known as

a) constant.

b) floating point variable of the array.

c) variable.

d) base type of the array.

Answer:

(d)

Explanation: There is no single data type for all arrays. Two array variables are considered to be of the same data type, only when they have the same rank and their elements have the same data type.

Q.25 Arranging the array elements in a specified order is called

a) sorting.

b) ordering.

c) arranging.

d) merging.

Answer:

a)

Explanation: Sorting algorithm is an algorithm that puts element of a list in a certain order. It can be in ascending order or descending order.

Computer Science - MCQ on Arrays

Class XII

Q.1 The list of a finite number n of similar data elements is known as a

a) structure.

b) array.

c) queue.

d) linked list.

Answer:

(b)

Explanation: An array is a data structure consisting of a group of elements that are accessed by indexing.

Q.2 The data structure in which the list is stored and accessed in LIFO technique is known as

a) array.

b) stack.

c) linked list.

d) tree.

Answer:

(b)

Explanation: A stack is an abstract data type and data structure based on the principle of Last In First Out (LIFO).

Q.3 The data structure which are accessed in FIFO technique is known as

a) array.

b) stack.

c) queue.

d) tree.

Answer:

(c)

Explanation: A queue is a particular kind of collection in which the entities in the collection are kept in order and the principal operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position.

Q.4 The data structure having a hierarchical relationship among nodes is known as

a) array.

b) linked list.

c) tree.

d) queue.

Answer:

(c)

Explanation: A tree is a widely used data structure that emulates a hierarchical tree structure with a set of linked nodes.

Q.5 The operation, which is performed on data structures, is

a) subtraction.

b) addition.

c) searching.

d) multiplication.

Answer:

(c)

Explanation: Searching involves searching for the specified data element in a data structure.

Q.6 Arranging the elements of a data structure in a specified

order is called

a) traversal.

b) merging.

c) sorting.

d) searching.

Answer:

(c)

Explanation: A sorting algorithm is an algorithm that puts elements of a list in a certain order.

Q.7 Processing all the elements of a data structure is known as

a) traversal.

b) sorting.

c) searching.

d) merging.

Answer:

(a)

Explanation: Traversal of a data structure means processing all the elements of it.

Q.9 For two dimensional array, the computer memory is allotted in

a) row major form.

b) column major form.

c) cell major form.

d) row major or column major form.

Answer:

(d)

Explanation: Row major form stores the 2-D array row wise and column major stores the 2-D array column wise.

Q.10 Single unit of values of certain type is known as

a) raw data.

b) data type.

c) data item.

d) data structure.

Answer:

(c)

Explanation: A named component of a data element, which usually is the smallest component, is known as data item.

Q.11 In C++, the lower bound and the upper bound are represented by

a) size-0.5 and 1.

b) size-0 and 1.

c) size- 0 and 10.

d) size 0 and 0.5.

Answer:

(b)

Explanation: Size specifies the number of elements in an array.

Array size(length) = upper bound-lower bound+1

Q.12 The starting address of the very first element of an array is known as

a) initial address.

b) flag address.

c) cell address.

d) base address.

Answer:

(d)

Explanation: In computing, a base address is an address serving as a reference point ("base") for other addresses.

Q.13 The function of Lsearch is similar to

a) Lfind.

b) Lpush

c) Lsort

d) Lget

Answer:

(a)

Explanation: The lsearch function is similar to the lfind function. It searches the given array for an element and returns it if found.

Q.14 The search, which can only work for sorted arrays, is known as

a) linear search.

b) binary search.

c) Lsearch

d) multilevel search.

Answer:

(b)

Explanation: A binary search algorithm is a technique for locating a particular value in a sorted list.

Q.15 In C++, the constant from Limits.h, which can be used to store minimum possible integer value, is known as

a) INT_MAX.

b) INT_MIN.

c) INT_LIM.

d) INT_VAL.

Answer:

(b)

Explanation: Insertion sort works if the very first element stores the minimum element of the array. In C++, INT_MIN constant from Limits.h, can be used to store minimum possible integer value.

Q.16 The sorting in which the adjoining values are compared and exchanged if they are not in proper order is

a) selection sort.

b) bubble sort.

c) insertion sort.

d) quick sort.

Answer:

(b)

Explanation: Bubble sort works by repeatedly stepping through the list to be sorted, comparing two items at a time and swapping them if they are in the wrong order.

Q.17 The sorting in which each successive element is picked and inserted at an appropriate position in the previously sorted array is

a) selection sort.

b) bubble sort.

c) insertion sort.

d) quick sort.

Answer:

(c)

Explanation: Its algorithm considers the elements one at a time, inserting each in its suitable place among those already considered (keeping them sorted).

Q.18 The sorting in which the smallest key from the remaining unsorted array is searched for and put in the sorted array is

a) selection sort.

b) bubble sort.

c) insertion sort.

d) quick sort.

Answer:

(a)

Explanation: In this type of sorting, first find the smallest in the array and exchange it with the element in the first position, then find the second smallest element and exchange it with the element in the second position, and continue in this way until the entire array is sorted. This is selection sort.

Q.19 The data structure whose size, structure and associated locations are fixed at compile time is known as

a) homogeneous data structure.

b) non-homogeneous data structure.

c) static data structure.

d) dynamic data structure.

Answer:

(c)

Explanation: In computer science, a static data structure is a data structure created for an input data set, which is not supposed to change within the scope of the problem.

Q.20 When all the elements of the data structure are of same type, then it is known as

a) homogeneous data structure.

b) non- homogeneous data structure.

c) static data structure.

d) dynamic data structure.

Answer:

(a)

Explanation: When items or entities in a group are similar, then they are said to be homogeneous. Similarly, when the elements of the data structure are of same type, then it is homogeneous data structure.

Practice Questions for CUET Computer Science chapter-Arrays SET-2

Q.21 When all the elements of the data structure are not of same type, then it is known as

a) homogeneous data structure.

b) non- homogeneous data structure.

c) static data structure.

d) dynamic data structure.

Answer:

(b)

Explanation: The data structure, which contains different type of data, is known as a non-homogeneous data structure.

Q.22 The data structure in which the elements are stored sequentially is known as

a) homogeneous data structure.

b) non-homogeneous data structure.

c) linear data structure.

d) non-linear data structure.

Answer:

(c)

Explanation: A linear data structure is one in which, while traversing sequentially, we can reach only one element directly from another. Eg- Liked List, Array.

Q.23 The data structure in which the elements are stored randomly is known as a

a) homogeneous data structure.

b) non-homogeneous data structure.

c) linear data structure.

d) non-linear data structure.

Answer:

(d)

Explanation: Data structures like trees, binary trees, graphs, and heaps are non-linear data structures as the elements are stored without any order.

Q.24 The pre-condition for the binary search is that

a) the array should be linear

b) the array should be sorted

c) the array should be homogeneous

d) the array should be non-linear

Answer:

(b)

Explanation: A binary search algorithm (or binary chop) is a technique for locating a particular value in a sorted list.

Q.25 Elements of one-dimensional array are stored in

a) dynamic memory location.

b) static memory location.

c) contiguous memory location.

d) non-contiguous memory location.

Answer:

(c)

Explanation: In a one-dimensional array, elements are stored in adjacent memory locations.

Q.26 The most efficient sorting is

a) insertion sort.

b) bubble sort.

c) selection sort.

d) merge sort.

Answer:

(a)

Explanation: Insertion sort has a linear running time (i.e., (n)). During each iteration, the first remaining element of the input is only compared with the right-most element of the sorted subsection of the array.

Q.28 The linear data structure among the following is

a) tree.

b) graph.

c) stack.

d) binary search tree.

Answer:

(c)

Explanation: In stack, the items are stored sequentially, thus forming a linear data structure.

Q.29 Data structure is an extension of

a) array.

b) data cells.

c) data bytes.

d) data type.

Answer:

(d)

Explanation: The organized collection of data is called a data structure. So, a data structure is combination of organized data and allowed operations.

Q.30 The number of bytes used to store one element is known as

a) element size.

b) element weight.

c) element capacity.

d) element store.

Answer:

(a)

Explanation: Element size is the space that the element needs for the storage purpose.