-
Notifications
You must be signed in to change notification settings - Fork 2
/
28.2 Method isBigger.java
51 lines (37 loc) · 1.19 KB
/
28.2 Method isBigger.java
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
41
42
43
44
45
46
47
48
49
50
51
/*
Sushant and Virat are playing a game. Virat tells 2 numbers to Sushant, who need to check whether the first is bigger than second. Implement a method boolean isBigger(int a, int b) which returns true if a is bigger than b and false otherwise.
Input Format
Two space separated integer value representing numbers given by Virat.
Constraints
Numbers will lie between 10 and 1000.
Output Format
true/false according to the value returned by the method or will print Invalid Input in case of numbers did not match the constraints.
Sample Input 0
50 40
Sample Output 0
true
Sample Input 1
50 50
Sample Output 1
false
*/
import java.io.*;
import java.util.*;
public class Solution {
static boolean isBigger(int a,int b)
{
return(a>b);
}
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if(a>=10 && a<=1000 && b>=10 && b<=1000)
{
System.out.print(isBigger(a,b));
}
else
System.out.print("Invalid Input");
}
}