HackerRank - Comparing Numbers

April - 25/2025

Problem:

Given two integers, X and Y, identify whether:

# Input

# Output

# Solution

            
    read X
    read Y
  
    if ((X < Y)); then
        echo "X is less than Y"
    elif ((X > Y)); then
        echo "X is greater than Y"
    else
        echo "X is equal to Y"
    fi 
        

# Solution_01

            
    read x;
    read y;
  
    if [ $x -gt $y ]; then 
        echo "X is greater than Y";
    elif [ $x -lt $y ] ; then 
        echo "X is less than Y";
    else 
        echo "X is equal to Y";
    fi 
        

Post: