Breaking News
You are here: Home / Program Code / UNIX / write a script to display the following pattern

write a script to display the following pattern

1

1 2

1 2 3

1 2 3 4

$vi pattern1.sh

i=1

while [ $i -le 5 ]

do
        j=1

        while [ $j -le $i ]
        do

                echo -e " $j \c"

                j=`expr $j + 1`

        done

        echo  -e "\n"
        i=`expr $i + 1`

done

:wq

Download Paper Solutions from Below Link

About admin

Scroll To Top