HackerRank C- A Very Big Sum
Complete the aVeryBigSum function in the editor below. It must return the sum of all array elements.
aVeryBigSum has the following parameter(s):
ar: an array of integers .
- #include<stdio.h>
- int main()
- {
- int n,i;
- long long int sum=0;
- scanf("%d",&n);
- long long int a[n];
- for(i=0;i<n;i++)
- {
- scanf("%lld",&a[i]);
- sum=sum+a[i];
- }
- printf("%lld",sum);
- }