Translate

Labels

Tuesday, 15 January 2013

SHELL PROGRAM

FIBONACCI SERIES OF A NUMBER

echo"Enter how many numbers: "
read num
num1=0
num2=1
echo"Fibonacci series:"
echo $num1
echo $num2
count=2
while[ $count-le $num ] 
do 
num3='expr $num1 + $num2'
echo $num3
num1=$num2
num2=$num2
count='expr 4count + 1'
done


DISPLAY TEN LEAP YEARS

for((i=2000;i<=2036;i++))
do
if['expr $i%400'=0]
then
echo"$i is a leap year "
elif['expr $i % 4'=0 -a 'expr $i % 100'!=0]
then
echo"$i is a leap year"
fi
done 

No comments: