Write a program to simulate echo command using C/C++?

How to achieve the above?

Thanks in advance