> A simple and beautiful Java console application that generates the famous Pascal Triangle ๐บ
---This project creates a Pascal Triangle (called "Paskal" in the code) using Java arrays and loops.
The program:
โ
Takes number of rows from user
โ
Generates Pascal Triangle dynamically
โ
Prints the triangle in console output
๐ Object-Oriented Java
๐ Dynamic 2D Arrays
๐ User Input with Scanner
๐ Clean Console Output
๐ Beginner Friendly Project
Each number is calculated using:
Array[i][j] = Array[i-1][j-1] + Array[i-1][j]
Example:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
rpaskal.javagit clone https://github.com/xedi1/Pascal-Triangle-Generator-in-Javajavac rpaskal.javajava rpaskal======= Paskal Creation ==========
Enter Number Rows:
5
Paskal Matrix|
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
| Technology | Usage |
|---|---|
| โ Java | Main Programming Language |
| ๐งฎ Arrays | Store Triangle Values |
| ๐ Loops | Generate Triangle |
| โจ๏ธ Scanner | User Input |
This project helps beginners learn:
โ
Java Classes & Objects
โ
Constructors
โ
Methods
โ
Nested Loops
โ
Dynamic Arrays
โ
Console Input/Output
๐น Better triangle formatting
๐น Center alignment output
๐น GUI version using Java Swing
๐น Save output to file
Made with Edi by using Java
If you like this project:
โญ Star the repository
๐ด Fork the project
๐ ๏ธ Improve the code