Posts

Showing posts from April 10, 2015

[Solved] Fibonacci Shell script Unix and Linux Forums

#fibonacci
echo "Enter a number"
read n
echo "Displaying fibonacci series upto " $n
a=-1
b=1

c=` expr $a \+ $b `

while [ $c -le $n ]
do
echo $c
a=$b
b=$c
c=` expr $a \+ $b `
done