Monday, May 07, 2012

Shell Script That Print The Series 1,2,6,24,120........9 Values

Hello friends today i'm sharing a shell script program that print the series 1,2,6,24..........9 values.
This is very simple script you can easily understand it.You are really enjoy when read it




#! /bin/sh

echo "Resultant series is:"

i=1
while test $i -le 9
do
    f=1
    j=$i
    while test $j -ne 0
    do
        f=` expr $f \* $j `
        j=` expr $j - 1 `
    done
    echo $f

    i=` expr $i + 1 `
done   






  

 



                 THANKING YOU FRIENDS.....

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts