x(n) = (n > 0) ? 1/2x(n-1) : 1 for n=1:10 println("n=",n," x(n)=", x(n))end
Standard input is empty
n=1 x(n)=0.5 n=2 x(n)=1.0 n=3 x(n)=0.5 n=4 x(n)=1.0 n=5 x(n)=0.5 n=6 x(n)=1.0 n=7 x(n)=0.5 n=8 x(n)=1.0 n=9 x(n)=0.5 n=10 x(n)=1.0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!