Created
April 4, 2019 05:20
-
-
Save r8d8/6eb76a66b2bd7a84a2ad4314dfe0bb66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "How many numbers do you want of Fibonacci series ?" | |
read total | |
x=0 | |
y=1 | |
i=2 | |
echo "Fibonacci Series up to $total terms :: " | |
echo "$x" | |
echo "$y" | |
while [ $i -lt $total ] | |
do | |
i=`expr $i + 1 ` | |
z=`expr $x + $y ` | |
echo $z | |
x=$y | |
y=$z | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment