MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In the array ‘names("John", “Ali", “Sarah")’, what is the value of element names(2)?
A
Ali
B
Sarah
C
John
D
None of the above
Explanation: 

Detailed explanation-1: -Array name is a type of name or a type of any element name that is share by all elements of an array but its indexes are different. Array name handle as a constant pointer, it can never change during execution of a program. Array name is also used to reach its all element.

Detailed explanation-2: -1. The correct answer is populating the array values.

Detailed explanation-3: -An array is a collection of similar types of data. For example, if we want to store the names of 100 people then we can create an array of the string type that can store 100 names. String[] array = new String[100]; Here, the above array cannot store more than 100 names.

Detailed explanation-4: -Array in C can be defined as a method of clubbing multiple entities of similar type into a larger group. These entities or elements can be of int, float, char, or double data type or can be of user-defined data types too like structures.

There is 1 question to complete.