prime=() #Define a array which used to store prime number,and you can also ignore this step
composite=()
for ((i=1;i<=100;i++));do
flag=1
#Attention: “flag=1” is a value assignment statements, while “flag = 1” is a command line
for ((j=2;j<=i/2;j++));do
if (( i % j == 0 ));then
flag=0
break
fi
done
if [ $flag == 1 ];then
prime+=(“$i”)
elif [ $flag == 0 ];then
composite+=(“$i”)
fi
#sleep 1
done
echo “${prime[@]}”
echo “The summary of prime number is: ${#prime[@]}”
echo “${composite[@]}”
echo “The summary of composite number is: ${#composite[@]}”