in reply to Need a code

... please provide me the code as early as possible.

I enthusiastically second the comments of others concerning this request and the OP in general!

... ask for the co-ordinates ... enter 5 - 8, the output should be GACG ...

Just a side note: The example given implies the use of base-1 indexing. It might be better to use the more common (certainly more common to Perl!) base-0 indexing, or else prominently to announce the use of, and the desire to continue to use, base-1 indexing.