# SS25
# Shell script to print prime numbers from 1 to 300
# Usage: SS25
n=1
echo $n
while [$n -le 300]
do
i=2
while [$i -le ‘expr $n -1‘]
do
if[‘expr $n % $i‘ -eq 0]
then
break
else
i=’expr $i+1‘
fi
done
if[$n -eq $i]
then
echo $n
fi
n=‘expr $n+1‘
No comments:
Post a Comment