c shell shell script to check the no is prime or not
@ i= 2
echo "\n enter the no to check prime"
@ n = $<
while ( $i < $n )
if ( $n % $i == 0 ) then
@ f = 0
break
else
@ f = 1
endif
@ i++
end
if ( $f == 1 ) then
echo "the given no. is prime"
else
echo "not a prime no."
endif
Comments