MULTIPLICATION TABLE


SOURCE CODE:
echo “ Enter the number ”
read i
echo “ $i table ”
j=1
while [ $i –le 12 ]
do
l=`expr $j \* $j = $l`
echo "$j * $i = $l"
j=`expr $j + 1`
done

OUTPUT:

[examuser35@localhost Jebastin]$ sh multable.sh
Enter the number
2
2 table
1 * 2 = 2
2 * 2 = 4
3 * 2 = 6
4 * 2 = 8
5 * 2 = 10
6 * 2 = 12
7 * 2 = 14
8 * 2 = 16
9 * 2 = 18
10 * 2 = 20
11 * 2 = 22
12 * 2 = 24
Previous
Next Post »

Still not found what you are looking for? Try again here.