File tree Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 1
1
import java .util .Scanner ;
2
- class FloydTriangle
3
- {
4
- public static void main (String [] args )
5
- {
6
- Scanner sc = new Scanner (System .in );
7
- System .out .println ("Enter the number of rows which you want in your Floyd Triangle: " );
8
- int r = sc .nextInt ();
9
- int n =0 ;
10
- for (int i =0 ; i < ;r ; i ++)
11
- {
12
- for (int j =0 ; j < ;=i ; j ++)
13
- {
14
- System .out .print (++n +" " );
2
+
3
+
4
+ class FloydTriangle {
5
+ public static void main (String [] args ) {
6
+ Scanner sc = new Scanner (System .in );
7
+ System .out .println ("Enter the number of rows which you want in your Floyd Triangle: " );
8
+ int r = sc .nextInt (), n = 0 ;
9
+
10
+ for (int i =0 ; i < r ; i ++) {
11
+ for (int j =0 ; j <= i ; j ++) {
12
+ System .out .print (++n + " " );
13
+ }
14
+ System .out .println ();
15
+ }
16
+ }
15
17
}
16
- System .out .println ();
17
- }
18
- }
19
- }
You can’t perform that action at this time.
0 commit comments