forked from srinathr91/TestJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello.java
More file actions
33 lines (27 loc) · 459 Bytes
/
Hello.java
File metadata and controls
33 lines (27 loc) · 459 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
public class Hello {
public static int method(int a,int b){
int x=0;
int y=0;
int ans=1;
while(ans<=b){
if(y<=a){
y++;
x++;
ans=ans*y;
}
else if(y>a && x<=b ){
//y++;
x++;
ans=ans*x;
}
}
return x-y+1;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("hello");
int val1=0;
int val2=0;
System.out.println(method(val1,val2));
}
}