-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStairCase.java
More file actions
67 lines (35 loc) · 778 Bytes
/
Copy pathStairCase.java
File metadata and controls
67 lines (35 loc) · 778 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
public class StairCase {
public static void main(String[] args) {
int r=25;
int c=20;
for(int i=1;i<=r;i++){
if(i%5!=0){
for(int j=0;j<=c;j++){
if(j<c){
System.out.print(" ");
}
else{
System.out.print(" *");
}
}
System.out.println(" ");
}
else{
for(int j=0;j<=c;j++){
if(j<(c-4)){
System.out.print(" ");
}
else if(j==c){
System.out.print(" *");
c=c-4;
}
else if(j>(c-4)){
System.out.print(" *");
}
}
System.out.println(" ");
}
//System.out.println(" ");
}
}
}