Reading month is over: the number of books each of n classmates read is in the array books. Write total_books(books, n) to return how many the class read in all. Nobody (n is 0) gives 0.
total_books({3, 5, 2}, 3)→10total_books({}, 0)→0int total_books(int books[], int n)int total_books(int books[], int n) {
int total = 0;
for (int i = 0; i < n; i++) {
// your code here: add the i-th classmate's books to total
}
return total;
}
Run tries the examples. When they look right, Submit.