Your 'A' array is 10 units large and you are writing to the 15th element. By all rights this should seg fault to, it's just a matter of chance that it does not. Moving this to the beginners section will provide more help if you need it.
Is it UB that I am experiencing or is there a valid reason for such behaviour?
It is undefined behavior that you are experiencing and there is a valid reason for such behavior. The valid reason is that it is undefined behavior and undefined behavior is.. well, undefined. It could do anything and have conforming behavior.