Sum an array · مجموع مصفوفة
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
English
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.
العربية
مجموع مصفوفة
أضف n أعداد صحيحة يشير إليها a. المؤشر مثل const int *a يعمل تمامًا كالمصفوفة — a[i] هو العنصر رقم 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. · أكمل int sum_array(const int *a, int n) لإرجاع مجموع عناصر n. لا تكتب main — المزود يقدم واحداً.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.