package javaapplication1;
// Floyd's triangle is a right-angled triangular of natural numbers
public class JavaApplication1 {
public static void main(String[] args) {
int i, j, rows = 7, n = 1;
for (i = 1; i <= rows; i++)
{
for (j = 1; j <= i; j++, n++)
System.out.print(n + " ");
System.out.println();
}
}
}
/*
run:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
*/