+ 2
Write a c++ program that uses a " for loop" to calculate the sum of six elements of an "array."
C++
3 Antworten
+ 3
int sum = 0;
int arr[6] = {1, 2, 3, 4, 5, 6};
for(size_t i = 0; i < 6; i++)
sum += arr[i];
+ 1
@CheeseMaster it didn't run
C++