echo "Enter a number: "
read num
sum=0
a=0
b=1
echo "Series is:"
while [ $sum -le $num ]
do
a=$b
b=$sum
sum=`expr $a + $b`
echo -e "$b \c"
done
echo -e "\n"
--------------------------------------------------------------------------------------------------------------
Enter a number:10
Series is:
0 1 1 2 3 5 8
0 comments:
Post a Comment