Skip to content

Pyramid pattern#495

Open
lieutenant-Rohit wants to merge 3 commits intokishanrajput23:mainfrom
lieutenant-Rohit:pyramidPattern
Open

Pyramid pattern#495
lieutenant-Rohit wants to merge 3 commits intokishanrajput23:mainfrom
lieutenant-Rohit:pyramidPattern

Conversation

@lieutenant-Rohit
Copy link
Copy Markdown

🚀 Add Pyramid Pattern Program in Java

📌 Description

This PR adds a Java implementation of a pyramid pattern using nested loops. The program prints a structured star (*) pyramid based on the number of rows specified.

✨ Features

  • Uses nested loops for pattern generation
  • Clean and readable structure
  • Easily adjustable number of rows (n)
  • Beginner-friendly logic for understanding patterns

🧠 Logic

  • Outer loop controls the number of rows
  • First inner loop prints spaces (n - i)
  • Second inner loop prints stars (i)

🛠️ Changes Made

  • Added PyramidPattern.java
  • Implemented pattern logic using loops
  • Included comments for clarity

✅ How to Test

  1. Compile the program
  2. Run the file
  3. Modify n to test different pyramid sizes

Comment thread Projects/JournalApp
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file used for?

Could you please provide clarification on this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants