Monday, May 07, 2012

Shell script that print the series 1^n,2^(n-1)...........(n-1)^2,(n-2)^1



Hello friends today i'm sharing a shell script program that print the series 1^n,2^(n-1).........(n-1)^2,(n-2)^1 . Read the script and enjoy!!!!!!!!!



#! /bin/sh
 
echo "Enter the value of n"
read n

i=1
j=$n
while test $i -le $n
do
    echo "$i^$j"
    j=` expr $j - 1 `
    i=` expr $i + 1 `
done





   



                         THANKS FRIENDS....

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts