Thursday, June 21, 2018

Write a shell script to print the pyramid structure for the given number. - OS

echo "enter the number"
read n
printf "\n"
for((i=1;i<=$n;i++))
do
for((j=1;j<=$i;j++))
do
printf "$j"
done
printf "\n"
done

No comments:

Post a Comment