No, it's not working properly because it won't compile. Two immediate problems are <conio> and <stdlib> are not a valid headers in any era of C++, and you don't qualify for the std namespace when using <iostream>.
I can't think of a compiler that would accept this code, so I can only assume you didn't compile it. Please don't waste people's time if you're not even willing to build your own code and look at error messages.
Once you fix those problems it will compile when the conio library is fully supported (clrscr() is the usual problematic one), but the code is still hideous and brittle. With perfect input it'll work...after a fashion.
I'm at the begining of my second start in cpp programming but... Deceptikon is right, and he was trying to help you. Only a little research for what he said.
I see that you declared this globally but you always capture from input to the first element of the array. What you wrote and I quote is equal to cin>>a;. You don't need the for statement. Also I don't think that this is what you need. I didn't pass this point.