Question: int[] anArray = new int [10]; int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; How could all

int[] anArray = new int [10]; int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; How could all values of 

int[] anArray = new int [10]; int [ ] anotherArray = {6, 7, 4, 5, 6, 2, 3, 5, 9, 1}; How could all values of anotherArray be totaled? Select one: a. foreach(int val in anotherArray) total + = val; b. Array.Sum(anotherArray) c. for (int i = 0; i < anotherArray.Length; i++) total + = anotherArray; d. all of the above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In this case lets reevaluate each option with the corrected syntax int anArray new int10 int another... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!