Bash shell –lt refers to less than –le indicate less than or equal to using simple mathematical algorithm it will perform the mathematical calculation and display Fibonacci series using Linux and UNIX shell programming . it use echo command to display the result.
Source code bash shell Programming Algorithm
echo "Enter the number"
read n
i=1
a=-1
fib=0
b=1
echo "Fibonacci series is"
while [ $i -lt $n ]
do
fib=`expr $a + $b`
a=$b
b=$fib
echo $fib
i=`expr $i + 1`
done
OUTPUT Find FIBONACCI SERIES CS1252 Operating Systems lap
[redhat35@localhost Rhel5]$ sh fib.sh
Enter the number
8
Fibonacci series is
0
1
1
2
3
5
8
Monday, May 17, 2010
Bash shell programming Find Fibonacci Series in Linux and UNIX Programming
Subscribe to:
Post Comments (Atom)
Labels
3D-2D Translation
Algorithms
Batch Programming
C language
C world
C++
DBMS
Ebook
Games
JAVA
Java Programs
JNTU MATERIALS
JNTU PREVIOUS QUESTION PAPERS
JNTU SYLLABUS BOOKS
LAB MANUALS
Linux
Mobile softwares
Networking
Online Programs
PC TIPS
Software Diagrams
Software Engineering
Softwares
System Software
Visual Basic
3 comments:
thanx........
check this out http://dileepmani19.blogspot.in/2012/04/fibonacci-numbers.html
check this out http://dileepmani19.blogspot.in/2012/04/fibonacci-numbers.html
Post a Comment