Shell script to print right traingle, Programming Languages

Right triangle




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


echo -e "enter num:\c"

read n




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



  j=`expr $n - $k`


  while test $j -gt 0         #this loop print forward spaces in each line


     echo -e "   \c"

     j=`expr $j - 1`





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


     echo -e " * \c"

     j=`expr $j + 1`



  echo " "

  k=`expr $k + 1`





enter num:7


                *  *

             *  *  *

          *  *  *  *

       *  *  *  *  *

    *  *  *  *  *  *

 *  *  *  *  *  *  *

Posted Date: 9/26/2012 4:35:28 AM | Location : United States

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

Write discussion on Shell script to print right traingle
Your posts are moderated
Related Questions
Suppose L is a context-free language and L' is regular. Show that L∩ L' is a context- free language. Specifically, if you're given a PDA diagram of L and a DFA diagram for L' , des

I''m doing a project for class in college and im supposed to use today''s date and figure out how old i am in months, days, minutes, and seconds. My question is what is the beset

Access Modifiers Convenience Modifiers or we can say (Access Specifies) identifies as the opportunity of accessibility of an Item and its associates. All C# kinds and kind associat

A large logistics company requires a software system to support the business processes associated with managing shift patterns of employees and making the associated payments. The

Objectives: Create an applet, Use methods from the Graphics class , Use the Color class General Instructions: The java class that need to be imported into this assignm

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Define an Example of Switch Statement? estimate(number) int number; /* Estimate a number as none, one, two, several, many */ {       switch(number) { case 0 :

can you give me online education system E-R daigram..

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