Program
echo "Enter two numbers"
read m n
echo "Numbers divisible by [$m] in the range [$m] to [$n]"
for((i=$m;i<=$n;i++))
do
div=`expr $i % $m`
if test $div -eq 0
then
echo $i
fi
done
OUTPUT
Safi $ bash samp.sh
Enter two numbers
3 20
Numbers divisible by [3] in the range [3] to [20]
3
6
9
12
15
18
echo "Enter two numbers"
read m n
echo "Numbers divisible by [$m] in the range [$m] to [$n]"
for((i=$m;i<=$n;i++))
do
div=`expr $i % $m`
if test $div -eq 0
then
echo $i
fi
done
OUTPUT
Safi $ bash samp.sh
Enter two numbers
3 20
Numbers divisible by [3] in the range [3] to [20]
3
6
9
12
15
18
No comments:
Post a Comment