The following program is used to print the Multiplication table of a given number. We have written two program below. One is used to print Multiplication Range upto 10 and another is used to Print Multiplication Table upto a given range. We have already written a C Program to print Multiplication Table earlier.

Here we are using a while loop to iterate. `expr`

is used to calculate whole number arguments.

## Shell Program to Print Multiplication Table

echo "Enter a Number" read n i=0 while [ $i -le 10 ] do echo " $n x $i = `expr $n \* $i`" i=`expr $i + 1` done

## Shell Program to Print Multiplication Table upto Given Range

echo "Enter a Number" read n echo "Enter Range" read r i=0 while [ $i -le $r ] do echo " $n x $i = `expr $n \* $i`" i=`expr $i + 1` done

{ 2 comments… read them below or add one }

There is a looping error!

Thank you Udit!