Virajsinh

Exam_Pyramid_OS_Script

Sep 29th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. echo "Exam Print Pyramid"
  2.  
  3. p=1
  4. echo -n "Enter Number :"
  5. read n
  6.  
  7. for (( i=0;i<=$n;i++ ))
  8. do
  9.  
  10. for (( k=$n;k>=$i;k-- ))
  11. do
  12. echo -n " "
  13. done
  14.  
  15. for (( j=1;j<=i;j++ ))
  16. do
  17. echo -n " $p"
  18. p=`expr $p + 1`
  19. done
  20. echo " "
  21. done
Add Comment
Please, Sign In to add comment