Monday, October 28, 2013

WAP to generate Fibonacci series

#WAP to generate Fibonacci series 

echo “Enter the range to be displayed” 

read n 
a=0
b=1
echo fibonacci series 
echo $a 
echo $b i=2 
while test $i -It $n 
do c = ‘expr $a + $b’ 
echo $c 
i=`expr$i+ 1’ 
a = $b 
b = $c 
done 

No comments:

Post a Comment