Greetings
Im trying to find some examples of iteration and recursion online - to better distinguish between them (very simple stuff)
Can someone confirm that this is an example of iteration, since the for loop iterates through numbers and no function is present that calls itself? Am i right in this assumption?
#Bash script to find factorial of a number
echo -n "Enter a number: "
read number
factorial=1
for(( i=1; i<=number; i++ ))
do
factorial=$[ $factorial * $i ]
done
echo "The factorial of $number is $factorial"
Example from: https://www.tutorialsandyou.com/bash-shell-scripting/factorial-17.html
Thanks in advance!