A Shell-script to check whether a given number is divisible by 3 or not.

echo -e “Enter the number::\c”

read n

if [ expr $n % 3 -eq 0 ]

then

echo $n is divisible by Three

else

echo $n is not divisible by Three

fi

 

OUTPUT::

 

Enter the number::58

58 is not divisible by Three

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.