/bin/echo is a C program, usually.
/bin/echo ls | sh
Voilà! A C program just wrote to the standard input of a running
shell, and a command was executed. This is demonstrably possible.
man popen is now your friend. (Any more is really beyond
SuperUser's scope, as is discussion of other things such as
system() and the need for quoting.)