Creative Minds
This site is for the creative students
Pages
Home
JAVA
JDBC
CProgramming
J2EE
ShellScript
Servlet
JSP
Friday, 27 March 2015
Shell Script to Find Factorial of a Number
3)write a Shell Script to Find Factorial of a Number?
clear
echo "enter number"
read fact
ans=1
counter=0
while [ $fact -ne $counter ]
do
counter=`expr $counter + 1`
ans=`expr $ans \* $counter`
done
echo "Total of factorial is $ans"
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment