Understanding the Differences between C and C++

I’ve been reading up on the differences between C and C++, and I came across this interesting article on the Difference between C and C++.

I took this question from distinctions between C and C++. Here’s a problem:

Problem Statement:
Given an array of integers, write a program in either C or C++ to find and print the sum of all the elements in the array.


  • The first line of input contains an integer ‘N’, denoting the number of elements in the array.
  • The second line contains ‘N’ space-separated integers, representing the elements of the array.

Print the sum of all elements of the array.

- 1 ≤ N ≤ 10^5
- -10^9 ≤ Array elements ≤ 10^9

Help me with the answer.
Thank you.

This forum is neither about C nor C++ but the Go language developed by Google.

Looks like a classic hacker rank question though, and usually the biggest problem with those is the parsing, not the logic.