FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
javaprogram/Armstrong.java at master · githubfordipesh/javaprogram · GitHub
githubfordipesh
javaprogram
Repository navigation
Code
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
javaprogram
/
Armstrong.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (21 loc) · 344 Bytes
Breadcrumbs
javaprogram
/
Armstrong.java
Copy path
File metadata and controls
21 lines (21 loc) · 344 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
import
java
.
util
.
Scanner
;
class
Armstrong
{
public
static
void
main
(
String
[]
args
)
{
Scanner
scan
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Enter a real no:"
);
int
x
=
scan
.
nextInt
();
int
temp
=
x
,
A
=
0
,
r
;
while
(
x
!=
0
)
{
r
=
x
%
10
;
A
+=
r
*
r
*
r
;
x
=
x
/
10
;
}
if
(
temp
==
A
)
System
.
out
.
println
(
"Armstrong no"
);
else
System
.
out
.
println
(
"not an Armstrong no"
);
}
}
Back
|
FazBrowse Home
|
New Git URL