CBSE - MCQ Question Banks (के. मा. शि. बो . -प्रश्नमाला )

PreviousNext

Q. 190601 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.

Right Answer is: C

SOLUTION

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. 190602 A data-structure whose elements form a sequence is


A. array.

B. union.

C. double.

D. structure.

Right Answer is: A

SOLUTION

Array is a data-structure whose elements form a sequence. When elements of linear structures are represented in memory by means of sequential(contiguous) memory location, these linear structures are called arrays.


Q. 190603 The data type of Age is


A. character.

B. alhanumeric.

C. numeric.

D. real.

Right Answer is: C

SOLUTION

Data type refers to to a named group of data which share similar properties or characteristics and, which have common behavior among them.


Q. 190604 Individual objects in an array are called its


A. elements.

B. data types.

C. indexes.

D. classes.

Right Answer is: A

SOLUTION

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. 190605 A dynamic array is same as


A. static array.

B. fixed size array.

C. resizable array.

D. dynamically-allocated array.

Right Answer is: C

SOLUTION

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


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


A. sorting.

B. ordering.

C. arranging.

D. merging.

Right Answer is: A

SOLUTION

Sorting algorithm is an algorithm that put elements of a list in a certain order. It can be in ascending order or descending order.


Q. 190607 The special list in which data elements are linked to one another is called


A. structure.

B. linked list.

C. stack

D. tree  

Right Answer is: B

SOLUTION

Linked lists are special lists of some data elements linked to one another. The logical ordering is represented by having each element pointing to the next element. Each element is called a node, which has two parts : INFO and POINTER.


Q. 190608 Queues data structures are


A. LIFO lists.

B. GIFO lists.

C. TIFO lists.

D. FIFO lists.

Right Answer is: D

SOLUTION

Queues data structures are FIFO ( First In First Out) lists, where insertions take place at the "rear" end of the queues and deletions take place at the "front" end of the queues.


Q. 190609 Transpose of a 2-D array involves


A. reversing all numeric entries.

B. interchanging of row and column elements.

C. interchanging the top and bottom rows.

D. interchanging the left and right columns.

Right Answer is: B

SOLUTION

The result of transposing an m x n matrix is an n x m matrix with property : 
MT(j,i) = M(i,j)
1<=i<=m,
1<=j<=n  


Q. 190610 If a structure named STUDENT contains ( Roll no., Marks, Grade), then Marks field will be referenced as


A. struct.Marks.

B. STRUCT Marks

C. STUDENT.Marks.

D. STUDENT.MARKS.

Right Answer is: C

SOLUTION

Structure refers to a named collection of variables of different data types. A structure gathers atoms of information that form a given entity. The elements of a structure are referenced using the dot operator.


Q. 190611 The technique followed in stacks is


A. GIFO.

B. FIFO.

C. TIFO.

D. LIFO.

Right Answer is: D

SOLUTION

Stacks data structures refer to the lists stored and accessed in a special way, where LIFO (Last In First Out) technique is followed. In stacks, insertions and deletions take place only at one end, called the top.


Q. 190612 The two types of data structures are


A. trees and stacks.

B. simple and compound.

C. primitive and non-primitive.

D. LIFO and FIFO.

Right Answer is: B

SOLUTION

Simple data structures are normally built from primitive data types like integers, real and characters. For example, arrays and structures.
Simple data structures can be combined in various ways to form complex structures called compound data structures. Compound data structures are classified into following two types : Linear data structures and non-linear data structures. 


Q. 190613 Integer allows digits from


A. 1 - 10.

B. 0 - 10.

C. 2 - 11.

D. 0 - 9.

Right Answer is: D

SOLUTION

Integers allows to only have digits ( 0 - 9) and +, - signs in the integer data i.e., numbers without fractions. C++ provides int data type to store integers.


Q. 190614 If a two dimensional array of integers is declared, with 5 rows and 5 columns, then the appropriate declaration is


A. *int [].

B. int [5].

C. int ** [5].

D. int * p[5].

Right Answer is: D

SOLUTION

It is an array of 5 int pointers.


Q. 190615 The pointer, which has a special value that indicates that it is not pointing to any valid reference or memory address, is called


A. reference pointer.

B. function pointer.

C. null pointer.

D. empty pointer.

Right Answer is: C

SOLUTION

A null pointer has a reserved value, often but not necessarily the value 0, indicating that it refers to no object.


Q. 190616 When we want to use data structures where, we may only know the maximum needed memory, but actual usage may be far less than that, then we use


A. dynamic memory allocation.

B. static memory allocation.

C. free store.

D. dereferencing memory.

Right Answer is: A

SOLUTION

The amount of memory needed is not known beforehand. When the program executes, i.e., during run time only memory is allocated, then it is dynamic memory allocation.


Q. 190617 In the conceptual memory map of a C++ program, the area used for function calls’ is


A. stack.

B. heap.

C. reserved area.

D. dynamic memory allocated area.

Right Answer is: A

SOLUTION

While a program executes, the stack region is used for many things. The stack is used for holding the return addresses at function calls, arguments passed to the functions and local variables for functions.


Q. 190618 The first element of an array num can be represented as


A. *num;

B. #

C. *num[I];

D. num;

Right Answer is: A

SOLUTION

Elements of an array can be accessed by *(num+i);
But, when *num is written, by default it returns the first element as 
i=0, for the expression *(num + i).


Q. 190619 A virtual function is called pure function, when it is equated to


A. zero.

B. one.

C. two.

D. many.

Right Answer is: A

SOLUTION

In C++, declaring pure virtual functions creates pure interfaces. A pure virtual function is declared as follows:
virtual void Activate() = 0;                       The “= 0” on the end of the declaration is supposed to represent the fact that the function has no implementation.


Q. 190620 The C++ statement cout<< &a; prints


A. address of a.

B. a.

C. an error.

D. the value of a.

Right Answer is: A

SOLUTION

The expression using & sign denotes the reference, hence this statement will print address(reference)of a.


Q. 190621 Object pointers are useful in creating objects at


A. compile time.

B. run time.

C. early binding.

D. starting of program.

Right Answer is: B

SOLUTION

Pointers point to an object created by class. Object pointers point to object at run time, also called late binding.


Q. 190622 Object pointers are used to access


A. public members of an object.

B. private members of an object.

C. protected members of an object.

D. global members of an object.

Right Answer is: A

SOLUTION

Only public members are available to object members as they can be accessed by the code outside the class.


Q. 190623 Object pointers are used to access public members of an object using


A. dot operator.

B. brackets.

C. access specifier.

D. arrow operator.

Right Answer is: D

SOLUTION

This is an arrow operator -> used to access public members of objects.


Q. 190624 The pointer that refers to an object, which currently invokes a member function, is called


A. object pointer.

B. member function pointer.

C. address pointer.

D. this pointer.

Right Answer is: D

SOLUTION

The term 'this pointer' refers to the object on which we are currently working.


Q. 190625 Pointers to objects of base class type


A. may be compatible with pointers to objects of a derived class.

B. may not be compatible with pointers to objects of a derived class.

C. should always be compatible with pointers to objects of a derived class.

D. should never be compatible with pointers to objects of a derived class.

Right Answer is: C

SOLUTION

This is the reason we use a single pointer variable to point to objects of base class as well as derived classes.


Q. 190626 To point to objects of base class as well as derived classes, we use


A. two pointers.(one for base class and one for derived class)

B. a single pointer.

C. many pointers.

D. four pointers. (two for base class, two for derived class)

Right Answer is: B

SOLUTION

Pointers to objects of base class type are compatible with pointers to objects of a derived class.


Q. 190627 A class containing pure virtual function is called


A. virtual class.

B. abstract class.

C. pure class.

D. derived class.

Right Answer is: B

SOLUTION

It is the pure interface within an abstract class, which define the common features encapsulated within it. They are the basis for the polymorphic behaviour of abstract classes. In C++, declaring pure virtual functions creates pure interface.


Q. 190628 We can use pointers with


A. arrays and structures only.

B. arrays and functions only.

C. functions and structures only.

D. arrays, structures and functions.

Right Answer is: D

SOLUTION

We can use pointers explicitly with all these three: structures, functions and arrays. A structure is a collection of variables under a single name. The main body of a program, identified by the keyword main and enclosed by the left and right braces is a function. An array is a collection of like objects.


Q. 190629 Consider the sample code: 
int a[]={1,4,8,5,1,4} int*ptr, x; ptr=*(a+4); x= *ptr-*a; Then, x in the sample code above is equal to


A. –3.

B. 0.

C. 4.

D. 4*sizeof (int).

Right Answer is: B

SOLUTION

Here, ptr=1 , x= *ptr-*a =1-1 =0.


Q. 190630 The address of the first byte is called


A. base value.

B. main address.

C. temporary address.

D. base address.

Right Answer is: D

SOLUTION

A pointer holds the address of the very first byte of the memory location where it is pointing to. The address of the first byte is known as base address.


Q. 190631 The statement :
const char *myPointer 
is  


A. a non-constant pointer to constant data.

B. invalid.

C. a constant pointer to constant data.

D. a non-constant pointer to non- constant data.

Right Answer is: A

SOLUTION

The const char *myPointer, is a non constant pointer to constant data. While char *const myPointer is a constant pointer to non constant data.


Q. 190632 The following is an example of -
struct S{  int a;
                    char name[20];                     S * n;
};


A. pointer to a structure.

B. self referential structure.

C. structure with different data types.

D. structure with array.

Right Answer is: B

SOLUTION

A structure having a member element that refers to the structure itself, is known as self-referential structure.


Q. 190633 If "p" is a character pointer then "p++" will increment "p" by


A. 1 byte.

B. 2 bytes.

C. 4 bytes.

D. 3 bytes.

Right Answer is: A

SOLUTION

Integers can be added to or subtracted from pointers using the operators +, -, +=, and -=. Each time a pointer is incremented by 1, it points to the memory location of the next element of its base type. When a character pointer is incremented, its value increases by 1. In pointer arithmetic, all pointers increase and decrease by the length of the data type they point to.


Q. 190634 To allocate memory space for a float array val[10], we will give


A. float val = new float(10);

B. float val = new float[10];

C. float *val = new float(10);

D. float *val = new float[10];

Right Answer is: D

SOLUTION

The operator new can also allocate memory for user defined types like structures, arrays and classes. To allocate memory for a one-dimensional array, new can be used in the following form:
pointer-variable = new data-type[size];
where size is the size of the 1-D array i.e., number of elements in the array.


Q. 190635 The structure pointers are declared by placing


A. & in front of a structure pointer's name.

B. . (dot) in front of a structure pointer's name.

C. * in front of a structure pointer's name.

D. NULL in front of a structure pointer's name.

Right Answer is: C

SOLUTION

C++ allows pointers to structures just as it allows pointers to int or char or float or any other data type. The pointers to structures are known as structure pointers. It takes the following general form :
struct - name *struct-pointer;
where struct-name is the name of an already defined structure and struct-pointer is the pointer to this structure.


Q. 190636 After the declaration const int N = 5 is made, the illegal statement is 


A. cout << N .

B. if (N == i + 3) .

C. cin >> N .

D. if (N == i + 4) .

Right Answer is: C

SOLUTION

Variables declared as const are not modifiable.


Q. 190637 Consider the following code :
struct Student
{
   int Rolno;
   char name[25];
   float marks;
   Student *next;
}

*next refers to


A. next Rolno.

B. next name.

C. next marks value.

D. structure Student itself.

Right Answer is: D

SOLUTION

A structure having a member element that refers to the structure itself is called self-referential structure. Here, *next refers to the structure Student itself. It is useful in defining linked lists wherein each element points to the next element of same type.


Q. 190638 The form of the operator delete that you would use to deallocate free store memory allocated by this statement is:
student_list = new students[size]  


A. delete []student_list.

B. delete student_list.

C. delete []student.

D. delete student[size].

Right Answer is: A

SOLUTION

When new is used to allocate free store for an array, use the form delete []expression, where expression is the expression of the left side of the corresponding new statement.


Q. 190639 The false statment about using const is


A. You cannot declare a constant pointer whose pointed-at value is constant.


B. A const variable cannot be used on the left side of an assignment.

 

C. A const value must be intialized when it is declared.

 

D. When used alone in a declaration, the base type of a const variable is implicitly int. 

 

Right Answer is: A

SOLUTION

You can declare a constant pointer whose pointed-at value is constant.
For example, 
cont int* const cp = &M_size;
This would declare cp to be a constant pointer whose pointed-at value is constant. The remaining of the statements about using const are true.  


Q. 190640 The expression p= new int[20];


A. allocates 20 integers and assigns the base address to p. 

B. allocates 20 integers of the stack local to a block.

C. reads in 20 integer values from cin.

D. allocates an integer of size 20 bytes.

Right Answer is: A

SOLUTION

The new allocates space for 20 contiguous integers from free store.


Q. 190641 Once a program is compiled, C++ creates four logically distinct regions of memory


A. code area, data area, stack area and heap.

B. new, delete, malloc and calloc.

C. heap, stack area, new and delete.

D. data area, stack area, new and delete.

Right Answer is: A

SOLUTION

Once a program is compiled, C++ creates four logically distinct regions of memory:
Code Area : Area to hold the compiled program code
Data Area : Area to hold global variables
Stack Area : Area to hold the return address of function calls, argument passed to the functions, local variables for functions and the current state of the CPU.
Heap : Area from which the memory is dynamically allocated to the program.


Q. 190642 If “p” were an integer pointer its value on “p++” would be incremented by


A. large number of bytes.

B. 4 bytes.

C. 1 byte.

D. 2 bytes.

Right Answer is: D

SOLUTION

Each time a pointer is incremented by 1, it points to the memory location of the next element of its base type. If “p” is a character pointer then “p++” will increment “p” by 1 byte. If “p” were an integer pointer its value on “p++” would be incremented by 2 bytes.


Q. 190643 When an object is passed by reference, the called function


A. creates its own copy of the object.

B. destroys its copy of the object.

C. invokes the object's constructor to create its copy of the object.

D. does not create copy of the passed object.

Right Answer is: D

SOLUTION

When an object is passed by reference, the called function does not create its own copy of the passed object. Rather it refers to the original object using its reference or alias name. Therefore, neither constructor nor destructor function of the object is invoked in such a case.


Q. 190644 Assume the following variable definitions
int arr[] = {4, 7, 11};
int *ptr = arr;
ptr++;
Here, ptr++  will point at


A. 4.

B. 11.

C. 18.

D. 7.

Right Answer is: D

SOLUTION

The array notation  arr[i]  is equivalent to the pointer notation  *(arr + i).
For the given code, if we write,
ptr ++;
it will point at 7
and
ptr-- ;
will point at 4.  


Q. 190645 The free store operator that frees the memory during runtime is called


A. delete.

B. new.

C. stored operator.

D. heap.

Right Answer is: A

SOLUTION

C++ defines two unary operators new and delete that peform the task of allocating and freeing (deallocating) memory during runtime. Since these operators new and delete operate upon the free store memory, they are called free store operators.


Q. 190646 Out of the following, the errorneous statement is
float x[]={ 2.6, 7.2, 3.1};
float *j;
float *k;
k=k/2;


A. float x[]={ 2.6, 7.2, 3.1};

B. float *j;

C. k=k/2;

D. float *k;

Right Answer is: C

SOLUTION

Multiplication and division operations cannot be performed on pointer and k is a pointer.


Q. 190647 Look at the statements below
             int ab=23;                                    int * def;                              char *cd; Out of the following, the invalid is


A. def = &ab;

B. ++def;

C. cd++;

D. cd = &ab;

Right Answer is: D

SOLUTION

ab is an integer and cd is a char pointer.


Q. 190648 The expression *marks refers to


A. pointer named marks

B. the value at the address in marks

C. the value stored in marks

D. the address in marks

Right Answer is: B

SOLUTION

The unary operator * returns the value of the variable located at the address following it(*-).


Q. 190649 A variable which stores the address of another variable is known as


A. pointer.

B. reference.

C. new.

D. delete.

Right Answer is: A

SOLUTION

There are two important operators when working with pointers in C++: the address of (&) operator and the value of (*) operator.


Q. 190650 In the dynamic memory allocation, the amount of memory to be allocated


A. is known.

B. can be known at any time.

C. can never be known.

D. is unknown.

Right Answer is: D

SOLUTION

In the dynamic memory allocation, the amount of memory to be allocated is not known. This memory is allocated during run-time as and when required. The memory is dynamically allocated using new operator.


Q. 190651 Out of the following, the false statement is


A. pointers should be initialized with NULL.

B. a constant pointer always points to the same address.

C. a pointer to a constant always points to the same value.

D. adding 1 to a pointer adds the size of the base data type.

Right Answer is: C

SOLUTION

A pointer to a constant refers to a pointer which is pointing to a symbolic constant. Using a pointer to a constant, the constant value can not be modified, however, the pointer can be made to point to another location.


Q. 190652 Out of the following statements, the correct statement is


A. The array name is a pointer holding the address of the first element.

B. All memory allocated, static  and dynamic, is freed when the program ends.

C. Memory is dynamically allocated from the free stack.

D. Addition and division are the arithmetic operations possible on pointers.

Right Answer is: A

SOLUTION

C++ treats the name of an array as if it were a pointer i.e., memory address of some element. C++ interprets an array name as the address of its first element.


Q. 190653 Identify the error in the following code
                     void main(){     int A[]={1,2,3,4,5};     int *a;     a = A;     *a = *a*2;     a = a*2;     cout<< a<< *a; }


A. a is a pointer, it cannot hold an array.

B. a is a pointer, it cannot be multiplied.

C. A is an array that has not been accessed.

D. no subscript (or index) has been declared for
A.

Right Answer is: B

SOLUTION

Only two arithmetic operations, addition and subtraction, may be performed on pointers.


Q. 190654 The most efficient sorting is


A. insertion sort.

B. bubble sort.

C. selection sort.

D. merge sort.

Right Answer is: A

SOLUTION

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. 190655 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.

Right Answer is: C

SOLUTION

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


Q. 190656 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.

Right Answer is: B

SOLUTION

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


Q. 190657 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.

Right Answer is: D

SOLUTION

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


Q. 190658 When all the elements of the data structure are of different types, then it is known as


A. homogeneous data structure.

B. hetrogeneous data structure.

C. static data structure.

D. dynamic data structure.

Right Answer is: B

SOLUTION

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


Q. 190659 When all the elements of a 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.

Right Answer is: A

SOLUTION

When items or entities in a group are similar, then they are said to be homogeneous.


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


A. linear search.

B. binary search.

C. Lsearch

D. multilevel search.

Right Answer is: B

SOLUTION

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


Q. 190661 Structure is a


A. simple data structure.

B. compound data structure.

C. heterogeneous data structure

D. homogeneous data structure

Right Answer is: A

SOLUTION

Structure refers to a named collection of variables of different types. It is Simple Data Structure.


Q. 190662 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.

Right Answer is: D

SOLUTION

In computing, a base address is an address serving as a reference point ,i.e., base, for other addresses.


Q. 190663 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.

Right Answer is: B

SOLUTION

Size specifies the number of elements in an array. Array size(length) = upper bound-lower bound+1.


Q. 190664 Single unit of values of a certain type is known as


A. raw data.

B. data type.

C. data item.

D. data structure.

Right Answer is: C

SOLUTION

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


Q. 190665 For a 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.

Right Answer is: D

SOLUTION

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


Q. 190666 The processing of all the elements of a data structure is known as


A. traversal.

B. sorting.

C. searching.

D. merging.

Right Answer is: A

SOLUTION

Traversal of a data structure means processing all the elements. In computer science, traversal refers to the process of visiting (examining and/or updating) each node in a tree data structure, exactly once, in a systematic way. Such traversals are classified by the order in which the nodes are visited.


Q. 190667 Arranging the elements of a data structure in a specified order is called


A. traversal.

B. merging.

C. sorting.

D. searching.

Right Answer is: C

SOLUTION

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


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


A. subtraction.

B. addition.

C. searching.

D. multiplication.

Right Answer is: C

SOLUTION

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


Q. 190669 The data structures which are accessed in FIFO technique is known as


A. array.

B. stack.

C. queue.

D. tree.

Right Answer is: C

SOLUTION

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. 190670 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.

Right Answer is: B

SOLUTION

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


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


A. a structure.

B. an array.

C. a queue.

D. a linked list.

Right Answer is: B

SOLUTION

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


Q. 190672 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.

Right Answer is: C

SOLUTION

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. 190673 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.

Right Answer is: A

SOLUTION

In this type of sorting, we first find the smallest element 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. The process continues in this way until the entire array is sorted. This type of sorting is known as selection sort.


Q. 190674 Examples of compound linear data structures are


A. Structures and Trees.

B. Linked Lists, Queues and Arrays.

C. Arrays and Stacks.

D. Stack and Queues.

Right Answer is: D

SOLUTION

In computer science, a stack is a "last in, first out(LIFO)" abstract data type and data structure. A queue is a particular kind of collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position.


Q. 190675 An array


A. has a finite size.

B. has elements of different data types.

C. has a name that holds the value of the first element.

D. can be allocated randomly in memory.

Right Answer is: A

SOLUTION

An array is always defined with a finite size. For Ex - int ar[10]; ar is an array of size 10.


Q. 190676 Fundamental data types in C++ are


A. char, int, float, real, double.

B. char, natural, float, real.

C. char, int, float, double, void.

D. char, int, real, double, void.

Right Answer is: C

SOLUTION

Fundamental types in C++ are divided into three categories: integral, floating, and void. Integral types are capable of handling whole numbers. Floating types are capable of specifying values that may have fractional parts. The void type describes an empty set of values.


Q. 190677 An array is a


A. compound linear data structure.

B. simple data structure.

C. non-linear data structure.

D. fundamental data type.

Right Answer is: B

SOLUTION

An array is a systematic arrangement of objects, usually in rows and columns. it is a simple data-structure.


Q. 190678 Two 2-D arrays can be added when


A. both have as many rows as columns.

B. both have same number of rows and columns.

C. the number of rows in one is same as number of columns in the other.

D. the number of elements is same in both.

Right Answer is: B

SOLUTION

Suppose A and B are mxn matrices. The sum of A and B , written as A+B, is the mxn matrix obtained by adding corresponding elements from A and B and the product of a scalar k and the matrix A, written as k.A, is the mxn matrix by multiplying each element of A by k.


Q. 190679 Two 2-D arrays can be subtracted when


A. both have as many rows as columns.

B. both have same number of rows and columns.

C. the number of rows in one is same as number of columns in the other.

D. the number of elements is same in both.

Right Answer is: B

SOLUTION

Suppose A and B are mxn matrices. The subtraction of A and B is the mxn matrix obtained only when the number of rows and columns of A and B are same.


Q. 190680 Two 2-D arrays can be multiplied when


A. both have as many rows as columns.

B. both have same number of rows and columns.

C. the number of rows in one is same as number of columns in the other.

D. the number of elements is same in both.

Right Answer is: C

SOLUTION

Suppose A and B are mxn matrices, then the product of A and B, written as AB, is the mxn matrix C, provided A is mxp and B is pxn matrix.


Q. 190681 Removal of a data element from a data structure is known as


A. deletion

B. getting

C. extracting

D. removing

Right Answer is: A

SOLUTION

Deletion is one of the basic operation, performed on data-structure, to delete a data-element.


Q. 190682 Correct form to declare an array is


A. int anarray[10];

B. int anarray;

C. anarray{10};

D. array anarray[10];

Right Answer is: A

SOLUTION

The square brackets ([ ]) after the type int indicates that anarray is an array of type int. This declaration declares an array named anarray that contains 10 integers.


Q. 190683 The number of rows in an array A[-3..5, -2..7] is


A. 10.

B. 90.

C. 9.

D. 19.

Right Answer is: C

SOLUTION

The number of rows = 5-(-3)+1 =9 (using UB-LB+1 for rows).


Q. 190684 Transpose of a 2-D array involves


A. reversing all numeric entries.

B. interchanging of row and column elements.

C. interchanging the top and bottom rows.

D. interchanging the left and right columns.

Right Answer is: B

SOLUTION

In linear algebra, the transpose of matrix A is another matrix AT created by any one of the following equivalent actions : -write the rows of A as the columns of AT -write the columns of A as the rows of AT -reflect A by its main diagonal (which starts from the top left) to obtain AT


Q. 190685 A matrix with 1 row can be called


A. structure.

B. vector.

C. stack.

D. tree.

Right Answer is: B

SOLUTION

One-row matrix is called a row vector. Similarly, a one-column matrix is termed as a column vector. A null matrix is one with all elements being zero.


Q. 190686 Free store is a


A. program.

B. pool of unallocated heap memory.

C. static memory allocation.

D. term used when system crashes.

Right Answer is: B

SOLUTION

A free store is a pool of unallocated heap memory given to a program that is used by the program for dynamic allocation during execution.


Q. 190687 In Bubble Sort


A. each element is in its proper position in a sorted sub array.

B. two adjoining values are compared and interchanged, if not in proper order.

C. the smallest value in the unsorted array is chosen and positions are exchanged.

D. values are arranged in different classes.

Right Answer is: B

SOLUTION

Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.


Q. 190688 In selection sort,


A. smallest key is repeatedly selected in the remaining unsorted array.

B. two adjoining values are compared and interchanged if not in proper order.

C. the smallest value in the unsorted array is chosen and positions are exchanged.

D. values are arranged in different classes.

Right Answer is: A

SOLUTION

Selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n2) complexity, making it inefficient on large lists and generally performs worse than the similar insertion sort.


Q. 190689 Arrays' rows are stored in sequence in


A. column minor.

B. column major.

C. row minor.

D. row major.

Right Answer is: D

SOLUTION

Row major linearization technique firstly stores the first row of the array, then second row of the array, then third row and so forth.


Q. 190690 Array columns are stored in sequence in


A. column minor.

B. column major.

C. row minor.

D. row major.

Right Answer is: B

SOLUTION

Column major linearization technique stores the first column, then the second column, then the third column and so forth.


Q. 190691 Diagonal elements of a 2-D array can be displayed when


A. the number of rows is greater than the number of columns in it.

B. the number of rows is less than the number of columns in it.

C. it has both rows and columns greater than 2.

D. the number of rows is equal to the number of columns in it.

Right Answer is: D

SOLUTION

While storing the elements of a 2-D array in memory, these are allocated contiguous locations. Therefore, a 2-D array must be linearised so as to enable their storage.


Q. 190692 In bubble sort, we


A. combine elements of two arrays to form a new array.

B. compare two adjoining values and interchange them, if not in proper order.

C. perform comparison sort in which the sorted array is built one entry at a time.

D. arrange values in different classes.

Right Answer is: B

SOLUTION

In bubble sort, the adjoining values are compared and exchanged if they are not in proper order. This process is repeated until the entire array is sorted.


Q. 190693 Topmost node in a tree is known as


A. leaves of the tree.

B. root of the tree.

C. info.

D. list.

Right Answer is: B

SOLUTION

Trees are multilevel data structures having a hierarchical relationship among its elements called nodes. Topmost node is called the root of the tree and bottommost nodes are called leaves of the tree.


Q. 190694 Binary search can be performed on


A. arrays sorted only in ascending order.

B. arrays sorted only in descending order.

C. sorted arrays.

D. only arrays that are unsorted.

Right Answer is: C

SOLUTION

Binary Search searches for the given item in a sorted array. The search segment reduces to half at every successive stage.


Q. 190695 Linear search can be performed


A. only on arrays sorted in ascending order.

B. only on arrays sorted in descending order.

C. any kind of array.

D. only on arrays that are unsorted.

Right Answer is: C

SOLUTION

In linear search, each element of the array is compared with the given Item to be searched for, one by one. This method, which traverses the array sequentially to locate the given Item, is called linear search or sequential search.


Q. 190696 The address of element SAMPLES [2] of array with element size as 2 bytes, lower bound as -3 and base address as 1000 will be


A. 1042.

B. 1010.

C. 1100.

D. 0010.

Right Answer is: B

SOLUTION

Address of element with subscript I = Base address + ES (I - L)
where ES is size of an array element
L is the lower bound of the array

Therefore, address of SAMPLES[2] = 1000 + 2 ( 2 - (-3))
                                                       = 1000 + 2 (5)
                                                       = 1010.


Q. 190697 An array is declared as ARR[-12 .. 6]. Its length is


A. 12.

B. 6.

C. 19.

D. 18.

Right Answer is: C

SOLUTION

When upper bound and lower bound of an array are given, its size is calculated as follows: Array size (length) = UB - LB + 1
                              =  6 - (-12) + 1
                              = 18 + 1
                              = 19.


Q. 190698 The basic operations on arrays are -


A. Editing, Traversal, Searching, Insertion.

B. Insertion, Printing, Modification, Traversal.

C. Creation, Insertion, Printing, Traversal, Sorting.

D. Insertion, Traversal, Deletion, Searching, Sorting.

Right Answer is: D

SOLUTION

The basic operations on arrays are :
Insertion - means addition of a new data element in an array.
Traversal - means processing all the data elements of an array.
Deletion - means removal of a data element from an array. The data element is searched for before its removal.
Searching - involves searching for the specified data element in an array.
Sorting - means arranging data elements of an array in a specified order.


Q. 190699 Each node in a singly linked list has


A. one pointer, pointing to the next node.

B. two pointers, one pointing to the next, the other to the previous node.

C. one pointer, pointing to the last node.

D. two pointers, one pointing to first, the other to the last node.

Right Answer is: A

SOLUTION

In singly linked lists, nodes have one pointer (next) pointing to the next node, whereas nodes of doubly linked lists have two pointers (prev and next). Prev points to previous node and next points to the next node in the list.


Q. 190700 For sorted arrays,


A. linear search works.

B. binary search works.

C. random search works.

D. sequential search works.

Right Answer is: B

SOLUTION

Binary search can work for only sorted arrays whereas linear search can work for both sorted as well as non sorted arrays.


PreviousNext