Shell script to print left traingle, Programming Languages

Left Triangle

 

Program

 

#W.A.S.S. to create left triangle

 

echo -e "enter num:\c"

read n

j=1

k=1

 

while test $k -le $n       #this loop print as many line of * as the value of k

do

  j=1

 while test $j -le $k      #this loop print as many * per line as the value of j

 do

     echo -e " * \c"

     j=`expr $j + 1`

done

echo " "

k=`expr $k + 1`

done

 

Output

 

enter num:7

 *

 *  *

 *  *  *

 *  *  *  *

 *  *  *  *  *

 *  *  *  *  *  *

 *  *  *  *  *  *  *

Posted Date: 9/26/2012 4:34:57 AM | Location : United States







Related Discussions:- Shell script to print left traingle, Assignment Help, Ask Question on Shell script to print left traingle, Get Answer, Expert's Help, Shell script to print left traingle Discussions

Write discussion on Shell script to print left traingle
Your posts are moderated
Related Questions
The following are required for this lesson: Complete the Project "Adding New Payments," which is the Karate Payments that includes the Adding New Payments, Deleting Payments,

Question: (i) All Security authentication mechanism that run on the TRU64 Unix Operating system run under the Security Integration Architecture (SIA ) layer. Explain with di

I need help with this question. The problem i''m having is that what''s the syntax for using dynamic memory allocation of objects of one class in the constructor of some other clas

I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

append two text files vertically

You are working for a cryptography department, where one of your jobs is to decipher intercepted messages that have been encrypted using a book cipher. The messages are sent by dif

ASP.NET Support for AJAX and JavaScript IntelliSense IntelliSense for Enthusiasm JScript makes it accessible client-script selection components in the value manager in Vision Facil

Let the player (denoted U in the diagram below) navigate around the board until she wins the game by finding the exit or is killed by a monster. A player begins the game with a sli

fow to I write a emplate that reads a set of numbers typed at the keyboard into an array of T

What are the Functions in Computer Programming? A program is completed up of one or more functions, with one of these being main(). Function is a self-contained block of progra