Saturday, 31 May 2014

Write a shell script to generate a multiplication table

Write a shell script to generate a multiplication table

echo Multiplication Table:
echo Which table do you want ? (Give Number):
read num
iter=1
while [ $num –le 5 ]
do
res=`expr $num \* $iter`
echo $num “*” $iter “=” $res
iter=`expr $iter + 1`
done

No comments: