Prime No
Write a Shell Script to Check Wheather a Number Is Prime Or not Shell Script: clear echo enter a number read n c=`factor $n|wc -w` if [ $c -eq 2 ] then echo prime number else echo not prime number fi OUTPUT: 1)[admin@localhost ~]$ sh prime.sh enter a number 34 not prime number 2)[admin@localhost ~]$ sh prime.sh enter a number 23 prime number
Tags:
Shell Script
0 comments