Exercise 3: 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 method 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.
Example
Input
rows
is equal to 5.
Then:
Get hands-on with 1400+ tech skills courses.