Fibonacci Series

Write a Shell Script to print Fibonacci Series Shell Script: clear echo enter number of terms read n i=1 a=1 b=1 echo the series is echo $a while [ $i -le $n ] do echo $b c=`expr $a + $b` a=$b b=$c i=`expr $i + 1` done OUTPUT: [admin@localhost ~]$ sh fibo.sh enter number of terms 6 the series is 1 1 2 3 5 8 13

Share:

0 comments