Shell Script to print Pyramid of Numbers
Q. How do I print pyramid of numbers in Bash
Ans.
Before writing bash script lets understand how we going to print this pattern. We do it in two part, first we are going to print part 1 and then we print the part 2. As you can notice from above figure that, in 2nd part we are printing number in reverse order till 1.
#!/bin/bash
#Taking input
read -p "Enter Number:" number
#Outer loop for
0 comments:
Post a Comment