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
THERE IS ANY1 COULD HELP ME WITH NETLOGO WORK

Define Functions with no arguments and no return values? When a function has no arguments it doesn't receive any data from the calling function. Likewise, it doesn't return any

Problem: This assignment is about deleting nodes from the binary search tree. You need to use given sequence to construct a binary search tree and then delete some nodes from

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string: Found cookies expiring bef

how to get horizontal motion vectors field with quiver ?

I am trying to get right side triangle in visual logic using for loop

hello there, I making a program for the collage but I got stuck at one point, I have a timmer that moves object pnl with the pnl.left function, but I want it when it gets to end of

Companies divide their subtasks of game's development. For large complex games, the development team can vary in size from 20 to 100 or more members. The most represented are artis

Identifying the Central Individual in a Social Network 1. Introduction You have just been hired by a social networking company! The division you are working in is particul

i doing a project about depth estimation, i have done some research, and i used the block matching algorithm to get the motion vectors from the image sequences, i now have the prob