Code Logo

Find Larger Number

Published at19 Apr 2026
Easy 0 views
Like0

This problem asks you to compare two integers and return the larger one.

If the first number is greater than or equal to the second number, print the first number. Otherwise, print the second number.

The task is only about comparing two values and choosing the bigger result.

Example Input & Output

Example 1
Input
a = 7, b = 7
Output
7
Explanation

Both values are equal, so the result is 7.

Example 2
Input
a = 3, b = 12
Output
12
Explanation

12 is larger than 3.

Example 3
Input
a = 9, b = 4
Output
9
Explanation

9 is larger than 4.

Algorithm Flow

Recommendation Algorithm Flow for Find Larger Number
Recommendation Algorithm Flow for Find Larger Number

Solution Approach

Start by reading the two integers.

After that, compare the first number with the second number.

If the first number is greater than or equal to the second number, print the first number.

If that condition is false, print the second number instead.

This works because one of the two numbers must be the larger value, and if they are equal, either one is a correct result.

Best Answers

Solutions Coming Soon

Verified best solutions for this Challenge are still being analyzed and will be available soon.