+ 2
Please explain the code below in description please..
int arr[] = {11, 35, 62, 555, 989}; int sum = 0; for (int x = 0; x < 5; x++) { sum += arr[x]; } cout << sum << endl; //Outputs 1652
2 Answers
+ 7
It's calculating the sum of array elements.
Explanation of something similar, hope it helps: https://www.sololearn.com/Discuss/400109/?ref=app
0
It calculates the sum of the arrays.
sum=sum+arr[x]
Here,it adds the current arr value to the previous sum.