This tutorial entitles “Number Pattern 1 using Loop in Java” will teach you on how you can display a number pattern forming a triangle using for loop. Please follow all the steps to complete this tutorial.
Looping is a common feature use in any programming language especially in Java Program. This is a repetition statement with condition. If the condition is meet, the repetition or the looping stop. There are three types of loop, the while loop, do while loop, and for loop.
Number Pattern 1 using Loop in Java Steps
- Create a new class and name it what you want to name.
2. Create a main method inside your class.
3. Insert the code below inside your main method for looping.
Remember: 1 start the looping and 5 end the looping.
4. Run your program and the output should look like the image below.
5. Complete Source Code