#! /bin/bashecho"*-------- divisible 1 ------------*"
divisible(){local num=$1echo"you wrote $num"reminder=$(($num%2))#reminder is to have the number divide by 2 (number ÷ 2), and the remaining figure echo"so ... the reminder cal is $num - ($num ÷ 2) = $reminder"}read-p"write your number: " aNum
divisible $aNumecho"*-------- divisible 2 ------------*"
divisible2(){local num=$1echo"you wrote $num"if[$(($num%2))-eq 0 ];then
echo"the number $num is devisible by 2"fi
if[$(($num%3))-eq 0 ];then
echo"the number $num is devisible by 3"fi
if[$(($num%5))-eq 0 ];then
echo"the number $num is devisible by 5"fi}read-p"write your 2nd number: " bNum
divisible2 $bNum#if bNum is 30, this is divisible by 2,3,5 ... not ideal, use for loop in divisible 3 sample echo"*-------- divisible 3 ------------*"
divisible3(){local num=$1echo"you wrote $num"for i in{2,3,5,7,11,13}do
if[$(($num%$i))-eq 0 ];then
echo"the number $num is devisible by $i"fi
done}read-p"write your 3rd number: " cNum
divisible3 $cNum