echo "enter a number "
read n
z=0
a=0
fib=0
b=1
echo " fibancci series is "
while [ $z -le $n ]
do
fib=`expr $a + $b`
a=$b
b=$fib
x="true"
m=$fib
for((y=$m-1;y>=2;y--))
do
if [ `expr $m % $y` -eq 0 ]
then
x="false"
break
else
x="true"
fi
done
if [ $x ="true" ]
then
echo "$m"
fi
z=`expr $z + 1`
done
---------- Post updated at 11:38 PM ---------- Previous update was at 11:33 PM ----------
i tried to fix it. Its working now but it didnt give me the result which i want !!!!
---------- Post updated at 11:38 PM ---------- Previous update was at 11:38 PM ----------
i tried to fix it. Its working now but it didnt give me the result which i want !!!!
---------- Post updated 04-04-11 at 09:38 PM ---------- Previous update was 04-03-11 at 11:38 PM ----------
I want the prime numbers from the fib.series number which the user enter as input!!
---------- Post updated at 08:12 PM ---------- Previous update was at 07:26 PM ----------
I want to print the prime numbers of the fib. number which the user put as input. For example the user enter 5 then the output will be the prime number of fib. series of number 5..
The submisstion of this assignment is tomorow and i couldnt get the right output so far