Ask Question
2 June, 01:22

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);

+5
Answers (1)
  1. 2 June, 01:43
    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?
Find 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 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