Thursday , August 17 2017
Home / Blue J / Java program for patterns and formats in java/bluej/c/c++

Java program for patterns and formats in java/bluej/c/c++

Java Program for format/pattern making in java/ Bluej
1
23
456
78910
This pattern is also called floyd’s triangle. You can also see Floyds triangle for N rows where n is inputted by user:
class format1
{
public static void main(String args[])
{
int i,j,k=1;
for(i=1;i<5;i++)   // This loop is For number of rows -5
{
for(j=i;j>0;j--)  // this is for columns in each rows(see in the pattern that number of columns depends on the value of i)
System.out.print(k++);
System.out.println(); // changing the line after each ith loop. For new row
}
}
}

OUTPUT:


java program for pattern 12345678910
Tags: pattern making in java, 1 23 456 78910 pattern-format.

Check Also

How to Solve Linear Equation in One Variable In C Programming?

C Program to Solve any Linear Equation in One Variable Find complete C program to ...

Leave a Reply

Your email address will not be published. Required fields are marked *