adplus-dvertising
frame-decoration

Question

What is right way to Initialize array?

a.

int num[6] = { 2, 4, 12, 5, 45, 5 };

b.

int n{} = { 2, 4, 12, 5, 45, 5 };

c.

int n{6} = { 2, 4, 12 };

d.

int n(6) = { 2, 4, 12, 5, 45, 5 };

Answer: (a).int num[6] = { 2, 4, 12, 5, 45, 5 };

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is right way to Initialize array?

Similar Questions

Discover Related MCQs

Q. An array elements are always stored in ________ memory locations.

Q. Size of the array need not be specified, when

Q. What does the following declaration mean?

int (*ptr)[10];

Q. Array passed as an argument to a function is interpreted as

Q. Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements?

Q. The smallest element of an array’s index is called its

Q. If the address of A[1][1] and A[2][1] are 1000 and 1010 respectively and each element occupies 2 bytes then the array has been stored in _________ order.

Q. An adjacency matrix representation of a graph cannot contain information of :

Q. The extra key inserted at the end of the array is called a,

Q. The largest element of an array index is called its

Q. An index or subscript is a _________ integer value, which indicates the position of a particular element in the array.

Q. In which language/languages, the smallest subscript value is 1 and the largest subscript value is n.

Q. Data elements grouped in an array can be of any basic data type like:

Q. One of the data types which can be used for storing a list of elements is an________.

Q. A programmer can access a particular element of an array by using one or more_________.

Q. If more than one subscript is used, an array is known as a__________.

Q. What is the simplest form of an array?

Q. What is allocated to the array at compile-time, before the program is executed?

Q. The memory address of the first element of an array is contained in the _______.

Q. Each element in an array is associated with a unique subscript value, starting from__________.