Ask Question
6 September, 08:35

Consider the following declaration: int alpha[5] = {3, 5, 7, 9, 11};. Which of the following is equivalent to this statement? int alpha[] = {3, 5, 7, 9, 11}; int alpha[] = {3 5 7 9 11}; int alpha[5] = {3, 5, 7, 9 11}; int alpha[4] = (3, 5, 7, 9, 11);

+1
Answers (1)
  1. 6 September, 10:05
    0
    int alpha[] = {3, 5, 7, 9, 11}

    Step-by-step explanation:

    int alpha[5] declares a list of 5 items. The values within the brackets needs to be separeted by commas, otherwise it'd produce an error. You can declare a list without specifying its size in the square brackets if you also declare its values, so the compiler will give reserve the memory needed.

    Last satement gives also an error because the size declared does not match with the amount of items.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the following declaration: int alpha[5] = {3, 5, 7, 9, 11};. Which of the following is equivalent to this statement? int alpha[] = ...” in 📙 Mathematics if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers