1.Write a shell script to print below pattern
#!/bin/bash
# Number of rows for the pattern
rows=4
# Loop through each row
for ((i=0; i<rows; i++)); do
# Print numbers from 0 to i
for ((j=0; j<=i; j++)); do
echo -n "$j "
done
# Move to the next line after each row
echo
done
Comments
Post a Comment