Fibonacci Range [Shell Program]



echo "Enter the
range"


read r


a=0


b=1


c=1


echo "Fibonacci
series:\n"


echo "$a $b
\c"


while [ $c -lt $r ]


do


c=`expr $a + $b`


if [ $c -le $r ]


then


echo "$c \c"


fi


a=$b


b=$c


done


echo "\n"











0 Comments