FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
basic-programs/java/Factorial.java at master · commitRahul/basic-programs · GitHub
commitRahul
/
basic-programs
Public
forked from
starVader/basic-programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
basic-programs
/
java
/
Factorial.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (12 loc) · 397 Bytes
Breadcrumbs
basic-programs
/
java
/
Factorial.java
Copy path
File metadata and controls
13 lines (12 loc) · 397 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
import
java
.
util
.*;
class
Factorial
{
public
static
void
main
(
String
args
[]){
Scanner
sc
=
new
Scanner
(
System
.
in
);
int
i
,
fact
=
1
;
int
number
=
sc
.
nextInt
();
//It is the number to calculate factorial
for
(
i
=
1
;
i
<=
number
;
i
++){
fact
=
fact
*
i
;
}
System
.
out
.
println
(
"Factorial of "
+
number
+
" is: "
+
fact
);
}
}
Back
|
FazBrowse Home
|
New Git URL