Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
echo -en "\ec"
echo "Script to find prime number"
echo Enter a number
num=50
flag=0
for((i=2;i<=num/2;i++))
do
flag=$((flag+1))
done
if [ "$flag" -gt 0 ]
then
echo "Not prime $flag $i"
else
echo "prime"
fi
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more