Monday, 27 May 2013

Shell Script for Fibbonacci Series

echo -n "Enter  Length of Fibbonacci Series:- "
read len
n1=1
n2=1
echo "$n1"
echo "$n2"
count=2
while test $count -le $len
do
n3=`expr $n1 + $n2`
n1=$n2
n2=$n3
echo "$n3"
count=`expr $count + 1`
done

No comments:

Post a Comment