MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
____ are each variable or cell in an Array.
A
Array
B
Variable
C
Element
D
Index
Explanation: 

Detailed explanation-1: -We can use an integer variable as the index of an array. If we use a for loop to count from 0 to the highest index, then we can process each element of an array. For example, the following code would sum the elements in the numbers array. We start at 0 because indexes start at 0.

Detailed explanation-2: -A cell array is a data type with indexed data containers called cells, where each cell can contain any type of data. Cell arrays commonly contain either lists of text, combinations of text and numbers, or numeric arrays of different sizes. Refer to sets of cells by enclosing indices in smooth parentheses, () .

Detailed explanation-3: -The index indicates the position of the element within the array (starting from 1) and is either a number or a field containing a number. The following rules apply when you specify an array name and index: The array name must be a unique symbolic name.

Detailed explanation-4: -An array is a sequence of values; the values in the array are called elements. You can make an array of int s, double s, String s, or any other type, but all the values in an array must have the same type. To create an array, you have to declare a variable with an array type and then create the array itself.

There is 1 question to complete.