Skip to content

Instantly share code, notes, and snippets.

@r8d8
Created April 4, 2019 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r8d8/6eb76a66b2bd7a84a2ad4314dfe0bb66 to your computer and use it in GitHub Desktop.
Save r8d8/6eb76a66b2bd7a84a2ad4314dfe0bb66 to your computer and use it in GitHub Desktop.
#!/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