Computer Science, asked by skis0716, 1 month ago

Write a c program to print the sum of 5 elements of an array. ​

Answers

Answered by aaratinarnawar2007
0

Answer:

Python

1. #Initialize array.

2. arr = [1, 2, 3, 4, 5];

3. sum = 0;

4. #Loop through the array to calculate sum of elements.

5. for i in range(0, len(arr)):

6. sum = sum + arr[i];

7. print("Sum of all the elements of an array: " + str(sum));

Explanation:

please mark my answer as brainliest

Similar questions