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 codeforwin.org #
 
PREVIOUS NEXT
Tagged: #find #sum #array
ADD COMMENT
Topic
Name
2+5 =