Skip to content

Commit ac0fc2b

Browse files
committed
Solution to find the Largest Number
1 parent 1a1247c commit ac0fc2b

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

‎src/Assignments/Problems.java‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,25 @@ public class Problems {
1010

1111
public static void main(String[] args) {
1212

13+
problems.findLargestNumber();
1314
// problems.calculateSimpleInterest();
14-
problems.computeWithFormula();
15+
// problems.computeWithFormula();
16+
}
17+
18+
void findLargestNumber(){
19+
Scanner firstInput = new Scanner(in);
20+
out.println("Enter FirstNumber: ");
21+
int firstNo = firstInput.nextInt();
1522

23+
Scanner secondInput = new Scanner(in);
24+
out.println("Enter SecondNumber: ");
25+
int secondNo = secondInput.nextInt();
26+
27+
if (firstNo > secondNo){
28+
out.println(firstNo+" is the Largest Number");
29+
}else {
30+
out.println(secondNo+" is the Largest Number");
31+
}
1632
}
1733

1834
void computeWithFormula(){

0 commit comments

Comments
 (0)