Ask Question
30 March, 10:17

Which of the following is a valid C+ + array definition?

A.

int array[0];

B.

float $payments[10];

C.

void numbers[5];

D.

int array[10];

+4
Answers (1)
  1. 30 March, 10:45
    0
    The correct answer for the given question is option (D) i. e int array[10];

    Explanation:

    As array is the collection of similar types of elements

    we can declared array

    Datatype arrayname[size];

    In option (A) the size of array is 0 which is wrong thats why this option is wrong.

    In option (B) the arrayname cannot start with ' $' thats why this option is wrong.

    In option (c) we cannot give void datatype as a arrayname thats why this option is wrong.

    So the correct option is (D) i. e int array[10];
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following is a valid C+ + array definition? A. int array[0]; B. float $payments[10]; C. void numbers[5]; D. int array[10]; ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers