Monday, May 07, 2012

Shell Script That Print The Series 1,4,27........9 Values

Hello friends,today i'm sharing shell script program that print the series 1,4,27,256.................9 values
I try to make this script very easy you can easily understand it and if you find any difficulties then share with me.... 



#! /bin/sh
 
i=1
echo "Resultant series is:"

while test $i -le 9
do
    j=1
    while test $j -lt  $i
    do
        j=` expr $j + 1 `
    done
        k=1
        p=1
        while test $k  -le $j
        do
       
            p=` expr $p \* $i `
           
            k=` expr $k + 1 `

        done
        echo $p
   
    i=` expr $i + 1 `
done




                            THANKS FRIENDS.......

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts