# Understanding an exercise about sub-sums in arrays

P

#### p_ei

Hello everyone,

I'm very new to C so I cannot understand how to define a solution for my task. I'm here to ask a little help in understanding and solving it.

So,

I've got an array of integer numbers (size N), let's name it a.

I have to create a function that return 1 if every number of the array is the sum of the two previous one.

Thanks for the help!

Last edited by a moderator:

#### FResher

let see few elements :
• an 'Array' with name 'a'
• a series of integers

- a special constraint to check :
all elements following each others which sum of third is equal the two integers before.

we can say that 'a' must be - > at less < - : of a size = 3.
and an array must be 'iterate', an Array must be 'fetch' : a loop will be useful.

you have to declare :
an array ( random size ) with integers in.
and to fetch the array, you need a loop.
a test will check if the third number of a series equal the first and the second in a sum.

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.