forked from joharbatta/DataStructure-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathr3.java
More file actions
20 lines (19 loc) · 341 Bytes
/
r3.java
File metadata and controls
20 lines (19 loc) · 341 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class rec
{
public int rec(int i) {
int result = 0;
if (i == 1)
return 1;
else
result = i * rec(i - 1);
return result;
}
}
class r3
{
public static void main(String[] args) {
rec r=new rec();
int result=r.rec(5);
System.out.println(result);
}
}