FIBNOCIS
SERIES:
echo "Enter choice="
read n
fib1=0
fib2=1
echo "The series are=$fib1 $fib2"
for ((i=0; $i<$n; i=`expr $i + 1|bc`))
do
fib3=`expr $fib1 + $fib2 |bc`
fib1=$fib2
fib2=$fib3
echo "$fib3"
done
OUTPUT:
[@localhost ~]$ sh fib.sh
Enter
choice=
10
The
series are=0 1
1
2
3
5
8
13
21
34
55
89
[@localhost
~]$
No comments:
Post a Comment
Thanks for your valuable comments