Help reading the array and sum of the array elements

Hi All,

need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.

Input Format

The first line of the input consists of an integer N . The next line contains space-separated integers contained in the array.

Output Format

Print a single value equal to the sum of the elements in the array.

1<=N<=10
0<=A<=10000000000
5
1000000001 1000000002 1000000003 1000000004 1000000005

Output

5000000015

what I have done so far:

code:

#input array size
read N
while [ $N -ge 1 -a $N -le 10 ]
do
echo $N
break
done
for i in `seq 0 N-1`;
do 
read -a array
if[ "${array}" -ge 0 -a "${array}" -le 10000000000 ]; then
echo "${array}"
fi
done
#sum=expr `sum + ${ array }`

Could you please let me know where I went wrong?

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.