diff --git a/.DS_Store b/.DS_Store index 27875fa6..4510cdaa 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/ft.java b/ft.java index 843f4a55..815dbd29 100644 --- a/ft.java +++ b/ft.java @@ -1,19 +1,17 @@ import java.util.Scanner; - 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(); -int n=0; -for(int i=0; i<r; i++) -{ -for(int j=0; j<=i; j++) -{ -System.out.print(++n+" "); + + +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(); + } + } } -System.out.println(); -} -} -} \ No newline at end of file