|I can only think that:|
1. You have need of such a program.
2. You are teaching yourself to program.
3. This is a homework question.
In which case:
1. There are plenty of programs to do this already. Just use the "copy" command.
2. Do a little reading; it's the only way that you will learn.
3. As 2.