SHELL SCRIPT TO PRINT TRIANGLE | URDINESH

Software Programming, Tutorials, Interview Preparations,Stock Market,BSE/NSE, General informations

Sunday, July 19, 2015

SHELL SCRIPT TO PRINT TRIANGLE

TRIANGLE:
clear
#geNerate the pyramid
echo "the series is"
for((i=5;i>=1;i--))
do
for((j=5;j>=i;j--))
do
echo -n $j " "
done
echo  -e
done


















OUTPUT:

the series is
5
5  4
5  4  3
5  4  3  2

5  4  3  2  1

No comments:

Post a Comment

Thanks for your valuable comments

Followers