Q2. Write down the steps to write and execute a C program to find factorial of any number in shell. code example
Example: write a program in shell script to find factorial of a number
#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"