Write a linux shell program to perform display multiplication table
Multiplication table
Code:
clear
echo -----------------------------------
echo '\tMultiplication Table'
echo -----------------------------------
echo Enter table number
read tn
echo Enter how many rows
read n
i=1
while [ $i -le $n ]
do
k=$(expr $i \* $tn)
echo "$i * $tn = $k"
i=$(expr $i + 1)
done
Output:
Enter table number
6
Enter how many rows
5
1 * 6 = 6
2 * 6 = 12
3 * 6 = 18
4 * 6 = 24
5 * 6 = 30
I not get the output for above coding.i got the error like line 10 command no found please clear the error and correct it
ReplyDeletethere's an error there...in while condition she kept n instead of tn
ReplyDeletehttp://imarahmarketing.com/
ReplyDelete