Can C capture stdin/out to interact with other programs as if it were using a shell?

view story

http://stackoverflow.com – I realise this is a strange question perhaps, but if say I have a program which can send commands to system like: system(command); The program can run and send commands to other programs via parameters like "ls -l". However, if I have a program that requires interactive input e.g. make use of scanf, is there a straightforward approach to enabling my C program to effectively interact with it. Apologies for the difficulty explaining my request. This is an exercise in a technical matter for reasons I can't concisely explain. (HowTos)