Shell script prints parallelogram, diamond

  • Shell script printing parallelograms
#!/bin/ bash


for ((i=1;i<= 9;i++))
do
for ((j=9;j>=i;j- -))
do
echo
-n " "
done

for ((j=2;j<= i;j++))
do
echo
-n "*"
done
for ((j=1;j<= i;j++))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
echo
done

Share a picture

  • Shell script printing diamond shape
# ! /bin/bash

for ((i=1;i<= 9;i++))
do
for ((j=9;j>=i;j- -))
do
echo
-n " "
done

for ((j=2;j<= i;j++))
do
echo
-n "*"
done
for ((j=1;j<= i;j++))
do
echo
-n "*"
done
echo
done

for ((i=1;i<= 9;i++))
do
for ((j=1;j<=i;j++< span style="color: #000000;">))
do
echo
-n " "
done
for ((j=8;j>=i;j--))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
echo
done

Share a picture

#!/bin/bash


for ((i=1;i<= 9;i++))
do
for ((j=9;j>=i;j- -))
do
echo
-n " "
done

for ((j=2;j<= i;j++))
do
echo
-n "*"
done
for ((j=1;j<= i;j++))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
echo
done

#! /bin/bash

for ((i=1;i<= 9;i++))
do
for ((j=9;j>=i;j- -))
do
echo
-n " "
done

for ((j=2;j<= i;j++))
do
echo
-n "*"
done
for ((j=1;j<= i;j++))
do
echo
-n "*"
done
echo
done

for ((i=1;i<= 9;i++))
do
for ((j=1;j<=i;j++< span style="color: #000000;">))
do
echo
-n " "
done
for ((j=8;j>=i;j--))
do
echo
-n "*"
done
for ((j=9;j>= i;j--))
do
echo
-n "*"
done
echo
done

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5531 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.