Step 1:Â First, we will declare a number of variables of integer data type according to the pattern of the pyramid. For example i, j,k, and rows. Variable i indicates the number of rows, variable j and k indicate the number of columns, and rows is used to take input from the user.
Step 2:Â Then, We will take the value from the user to print the number of rows to print using Scanner and store it in the rows variable.
Step 3: We will write more than two ‘for’ loops according to the pattern of the pyramid. The outer ‘for’ loop iterates the number of rows, while other inner loops iterate the number of columns as per requirement. The symbol, character, and numbers are then printed based on the number of columns. We will write a print statement in the second loop for printing symbols or characters or numbers.
