A shell-script to accept a no. and prints it’s multiplication table.

echo -e “Enter the number:\c”

read n

for ((i=1;i<=10;i++))

do

temp=expr $i \* $n

echo $n “*” $i = $temp

done

 

OUTPUT::

 

Enter the number:5

5 * 1 = 5

5 * 2 = 10

5 * 3 = 15

5 * 4 = 20

5 * 5 = 25

5 * 6 = 30

5 * 7 = 35

5 * 8 = 40

5 * 9 = 45

5 * 10 = 50

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.