helpdesk talks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
273 B

  1. #!/bin/bash
  2. echo "How many numbers do you want of Fibinacci series?"
  3. read total
  4. x=1
  5. y=1
  6. i=2
  7. echo "Fibonacci Series up to $total terms :: "
  8. echo "$x"
  9. echo "$y"
  10. while [ $i -lt $total ]; do
  11. i=`expr $i + 1 `
  12. z=`expr $x + $y `
  13. echo "$z"
  14. x=$y
  15. y=$z
  16. done