Warning: mysqli_connect(): (HY000/2002): Connection refused in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 38

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 40

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 41

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 45

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 48

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 49
Java program for patterns and formats in java/bluej/c/c++ - Get Program Code
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

program for display lower triangular matrix in java

What is Lower Triangular Matrix? Lower Triangular Matrix is if all the elements above the main ...

Leave a Reply

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

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.