Thursday, May 1, 2008

Write a program to find the factorial value of any number entered through the keyboard.

# SS19

# Script to find the factorial value of any given number

# Usage: SS19

echo Enter any number

read num

i=1

fact=1

while [$i -le $num]

do

fact=’echo $fact \* $i | bc‘

i=’expr $i+1‘

done

echo factorial value of $num = $fact

No comments: