Update and rename ft.java to FloydTriangle.java

This commit is contained in:
Varun Upadhyay
2017-10-24 10:37:46 -07:00
committed by GitHub
parent 810fdd6102
commit 87b1f77e56

17
Others/FloydTriangle.java Normal file
View File

@@ -0,0 +1,17 @@
import java.util.Scanner;
public class FloydTriangle {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows which you want in your Floyd Triangle: ");
int r = sc.nextInt(), n = 0;
for(int i=0; i < r; i++) {
for(int j=0; j <= i; j++) {
System.out.print(++n + " ");
}
System.out.println();
}
}
}