Well can you show us what you have put together already? Our first rule around here is that we ask people to show some kind of effort in attempting to solve the problem themselves. We don't do homework, but we will gladly help guide you through the problem and correct anything you might have wrong.
Some things to look at for this would be the use of two loops, one nested inside the other. The outer loop will move through the array one by one and the inner loop will start from the current position of your outer loop and loop through until the end.
So lets say you have 5 items in your array. The outer loop will start at zero and your inner loop will start at 1 and go to index 4. Then your outer loop will move to index 1 and your inner loop will start at 2 and go to index 4. See a pattern?
You would continue the outer loop until you are 1 less than the total size of the array, so for our example you would stop after processing index 3.
Hope that makes sense. Show us what you have and we can help you further. Oh and don't forget to use code tags...