Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Shell Script to create a pyramid of number

Posted By: Vilhelm Fischer     Category: Unix / Linux / Ubuntu     Views: 18778

Write a Shell Script to create a pyramid of number.

1
22
333

Code for Shell Script to create a pyramid of number in Unix / Linux / Ubuntu

echo "enter the number"
read n
for((i=1;i<=n;i++))
dofor ((j=1;j<=i;j++))
 do
 echo -e "$i \c"
 done
 echo " "
done




OUTPUT
***********
$ sh pattern.sh
enter the number
3
1
2 2
3 3 3
  
Share: 


Didn't find what you were looking for? Find more on Shell Script to create a pyramid of number Or get search suggestion and latest updates.

Vilhelm Fischer
Vilhelm Fischer author of Shell Script to create a pyramid of number is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!