VISUAL BASIC

VISUAL PROGRAMMING

VISUAL BASIC

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is assigning initial values to an array is often referred to as?
A
sorting the array
B
population the array
C
assigning the array
D
declaring the array
Explanation: 

Detailed explanation-1: -The process of assigning values to the array elements is called array initialization.

Detailed explanation-2: -The initializer for an array is a comma-separated list of constant expressions enclosed in braces ( ). The initializer is preceded by an equal sign ( = ). You do not need to initialize all elements in an array.

Detailed explanation-3: -Assigning values to associative array variable elements can be done by using the assignment statement in which the array is named, the index value is specified and the corresponding element value is assigned.

Detailed explanation-4: -Multidimensional arrays can be described as “arrays of arrays". For example, a bi-dimensional array can be imagined as a two-dimensional table made of elements, all of them hold same type of elements. (remember that array indices always begin with zero).

Detailed explanation-5: -The first element of the array is represented by index 0, and the last element of the array is represented by index 9. In the simplest terms, a one-dimensional array in C is a list. Each element of the list contains only one value, whether that value be an int, char, or float.

Detailed explanation-6: -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.

Detailed explanation-7: -Array Initialization Using a Loop An array can also be initialized using a loop. The loop iterates from 0 to (size-1) for accessing all indices of the array starting from 0. The following syntax uses a “for loop” to initialize the array elements. This is the most common way to initialize an array in C.

There is 1 question to complete.