Virajsinh

Pyramid_3_OS_Script

Oct 7th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. echo "Pyramid 3 Diamond"
  2. echo -n "Enter Num Of Pyramid : "
  3. read n
  4.  
  5. for (( i=1; i<=$n; i++ ))
  6. do
  7. for (( k=n; k>$i; k-- ))
  8. do
  9. echo -n " "
  10. done
  11.  
  12. for (( j=1; j<=$i; j++ ))
  13. do
  14. echo -n " *"
  15. done
  16. echo " "
  17. done
  18. for (( i=$n; i>=1; i-- ))
  19. do
  20. for (( j=$n; j>=$i; j-- ))
  21. do
  22. echo -n " "
  23. done
  24.  
  25. for (( k=1; k<$i; k++ ))
  26. do
  27. echo -n " *"
  28. done
  29. echo " "
  30. done
Add Comment
Please, Sign In to add comment