FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java-Programs/Other-Java-Programs/StarPattern.java at master · iamarav/Java-Programs · GitHub
iamarav
/
Java-Programs
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java-Programs
/
Other-Java-Programs
/
StarPattern.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (27 loc) · 683 Bytes
Breadcrumbs
Java-Programs
/
Other-Java-Programs
/
StarPattern.java
Copy path
File metadata and controls
40 lines (27 loc) · 683 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
java
.
util
.
Collections
;
import
java
.
util
.
Scanner
;
public
class
StarPattern
{
public
static
void
main
(
String
[]
args
) {
System
.
out
.
println
(
"Program to get a star Pattern for an input.
\n
---"
);
Scanner
sm
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"Enter an integer value: "
);
int
val
=
sm
.
nextInt
();
if
(
val
>
10
||
val
<
1
) {
System
.
out
.
println
(
"Out of limit"
);
end
();
}
else
{
for
(
int
i
=
val
;
i
>
0
;
i
--) {
for
(
int
j
=
i
;
j
>
0
;
j
--) {
System
.
out
.
print
(
"*"
);
}
System
.
out
.
print
(
"
\n
"
);
}
end
();
}
}
private
static
void
end
() {
System
.
out
.
println
(
"---
\n
The Program has ended."
);
System
.
exit
(
0
);
}
}
Back
|
FazBrowse Home
|
New Git URL