Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to find sum of array

//C++
int arr[5]={1,2,3,4,5};
int sum=0;
for(int i=0; i<5; i++){sum+=arr[i];}
cout<<sum;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #sum #array
ADD COMMENT
Topic
Name
5+8 =