>y[i]=double (sin (double i));
I guess this should just be
y[i]=sin(i);
Why those extra double's?
About printf, is your problem a link time error of not finding TERMIO_PutChar?
If so, search this forum for TERMIO_PutChar.
To use printf with doubles, also make sure your STACKSIZE in the prm is big enough.
Daniel