GNU nano 2.9.3 prime !/bin/bash echo "Enter a number" read n for((i=2;i<n;i++)) do if [ `expr $n % $i`-eq 0 ] then c=`expr $c + 1` fi done if [ $c -eq 0 ] then echo "prime" else echo "not prime" fi
No comments