-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNumberSequenceTriangle.java
More file actions
26 lines (22 loc) · 1016 Bytes
/
NumberSequenceTriangle.java
File metadata and controls
26 lines (22 loc) · 1016 Bytes
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
public class HelloWorld{
static int a= 1;
public static void main(String []args){
int n=5;
for(int i=0;i<n;i++)
{
int k=i;
for(int j=0;j<=k;j++)
{
System.out.print(" "+a);
a=a+1;
}
System.out.println("");
}
}
}
//OUTPUT
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15