We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<iostream>usingnamespacestd;intmain(){intn,i;cin>>n;//limit of the array.intar[n];intsum=0;for(i=0;i<n;i++){cin>>ar[i];}for(i=0;i<n;i++){sum=sum+ar[i];}cout<<sum;return0;}
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
Very simple C++ code.