#PROGRAM TO DISPLAY TABLE OF NUMBER-WHILE LOOP
read x
i=1
while [ $i -lt 13 ]
do
echo " $x x $i = ` expr $x \* $i `"
i=`expr $i /* 1`;
done
---------------------------------------------------------------------------------------
# SAME PROGRAM USING FOR LOOP
echo enter number for table
read n
for (( i=1;i<=12;i++ ))
do
echo " $n x $i= `expr $n \* $i` ";
done
echo THANK U CODED BY TG
#OUTPUT:
#enter number for table
#10
# 10 x 1= 10
#10 x 2= 20
#10 x 3= 30
#10 x 4= 40
#10 x 5= 50
#10 x 6= 60
#10 x 7= 70
#10 x 8= 80
#10 x 9= 90
#10 x 10= 100
#10 x 11= 110
#10 x 12= 120
#THANK U CODED BY TG#
No comments:
Post a Comment