Sum an array · Jumlahkan satu senarai
Sum an array
Add the n integers that a points to. A pointer like const int *a works just like an array — a[i] is the i-th element.
Jumlahkan array
Jumlahkan n bilangan bulat yang ditunjuk oleh a. Sebuah pointer seperti const int *a bekerja sama persis dengan array — a[i] adalah elemen ke-i.
Complete int sum_array(const int *a, int n) to return the sum of the n elements. Do not write main — the checker provides one. · Selesaikan int sum_array(const int *a, int n) untuk mengembalikan jumlah elemen n. Jangan tulis main — pemeriksa menyediakan satu.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.