A very big sum
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n; //array size
cin>>n;
long long int a[n]; //array
for(int i=0;i<n;i++){ //array elements
cin>>a[i];
}
long long sum=0; //initialize to zero for storing sum
for(int i=0;i<n;i++){ //to add all the elements
sum=sum+a[i];
}
cout<<sum; //print the sum
return 0;
}
A Very Big Sum HackerRank Solution in C++
A Very Big Sum HackerRank Solution in Cpp
A Very Big Sum HackerRank Answer
0 Comments