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"











Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C