-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathNumber Pattern 1.java
More file actions
52 lines (43 loc) · 889 Bytes
/
Number Pattern 1.java
File metadata and controls
52 lines (43 loc) · 889 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Number Pattern 1
// Send Feedback
// Print the following pattern
// Pattern for N = 4
// 1
// 23
// 345
// 4567
// Input Format :
// N (Total no. of rows)
// Output Format :
// Pattern in N lines
// Sample Input 1 :
// 3
// Sample Output 1 :
// 1
// 23
// 345
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
/* Your class should be named Solution.
* Read input as specified in the question.
* Print output as specified in the question.
*/
Scanner s=new Scanner(System.in);
int N=s.nextInt();
int i=0;
int j;
int count;
while(i<=N)
{ j=i;
count=0;
while(count<i)
{ System.out.print(j);
j++;
count++;
}
i++;
System.out.println();
}
}
}