Write a Java Program to Print Floyd’s Triangle using For Loop

By | January 29, 2017

Write a Java Program to Print Floyd’s Triangle using For Loop


 

To print the Floyd’s triangle in Java programming, you have to use two for loops, the outer loop is responsible for rows and the inner loop is responsible for columns and start printing the Floyd’s triangle as shown in the following program.

As we know that, Floyd’s triangle is a right angled-triangle using the natural numbers, so the following Java Program ask to the user to enter the range ( how many line he/she want) to print the Floyd’s Triangle.

  • Following is the sample of Floyd’s Triangle :

 

SOURCE CODE ::

 

 

OUTPUT ::

 

 

Leave a Reply