Challenge: Pyramid Printing By Using For Loop
In this exercise, you have to print half a pyramid for a given number of rows.
We'll cover the following...
Problem Statement #
Write code which prints half a pyramid of the alphabet a.
- The code takes an integer variable
rows
as input and prints the pyramid with that number of rows displayinga
.
Hint: Use
for
loops to implement the solution.
Input #
an integer
Output #
print half pyramid using a
or \n
on the console
Sample Input #
rows
is equal to 5.