CHRIST MCA 2009-2012
Would you like to react to this message? Create an account in a few clicks or log in to continue.

3. WASS to find the factorial of a number

Go down

3.	WASS to find the factorial of a number  Empty 3. WASS to find the factorial of a number

Post  sowmya Wed Jul 21, 2010 9:47 pm

clear
echo "Enter a number"
read n
f=$n
n=`expr $n - 1`
while test $n -gt 0
do
f=`expr $f \* $n`
n=`expr $n -1`
done
echo "The factorial is $f"

sowmya

Posts : 5
Join date : 2010-07-21

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum