I need to write a statement that will print out the size of the array. I have it to where it will print out just 0 but I need the size of the array. I can't change anything above where it says "Write your statement here"
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//Declarations for Case 1:
int numberOfElements{ 0 };
double myArray[20]{};
//Write the statement below that will CALCULATE the number of elements that are in myArray
//and assign the result to the variable numberOfElements. You must use a formula (not a loop)
//to receive credit for this problem.
//Note that myArray is already declared for you above.
//Write your statement here:
/**************************************************************************************************************/
int num_elements = sizeof(myArray) / sizeof(myArray[0]);
cout << numberOfElements << endl;