I don't know if it is possible. suppose I have a plain text 123.after encypting the text it becomes 234. now i have both plain text and encypted text. Can i get the encyption algoritm from these?
It depends on what do you want to mean by "get" and "algorithm". Because if you want to know in your mind what the algorithm is - then yes, after some analysis you could get that (mostly for simpler algorithms). Also you could understand the algorithm even after some paper+pencil work if such would be needed. Third option is to get algorithm in form of computer language - this depends on algorithm complexity and rules = mode of action. For some algorithms you could be able to write a computer language code to encrypt/decrypt, but for some - not (it's rare, many things can be coded).
Mostly if you can understand the given algorithm (you know how to encrypt or decrypt) then you can write code for one/both of these processes.