Operating System Shell Scripting/Programs on Linux
Linux Shell Scripting programs
Sunday, 17 June 2012
Write a shell script to generate fibonacci series.
echo Enter the number of terms you want to be in the series;
read n
a=0
b=1
j=0
echo 0
echo 1
while [ $j -lt $n ]
do
c=`expr $a + $b`
echo $c
a=$b
b=$c
j=`expr $j + 1`
done
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment