Furthermore, you have nothing in A[] to work with. You will tend to get better responses if you explain how your code is failing to meet your expectations. You're making us guess, is that nice? Fortunately you have some obvious blunders.