# Comparing Numbers – HackerRank Solution

In this post, we will solve Comparing Numbers HackerRank Solution. This problem (Comparing Numbers) is a part of Linux Shell series.

Given two integers,Â XÂ andÂ Y, identify whetherÂ X < YÂ orÂ X > YÂ orÂ X = Y.

Exactly one of the following lines:
–Â X is less than Y
–Â X is greater than Y
–Â X is equal to Y

## Input Format

Two lines containing one integer each (XÂ andÂ Y, respectively).

## Output Format

Exactly one of the following lines:
–Â X is less than Y
–Â X is greater than Y
–Â X is equal to Y

Sample Input

Sample Input 1

``````5
2  ``````

Sample Input 2

``````2
2  ``````

Sample Input 3

``````2
3  ``````

Sample Output

Sample Output 1

``X is greater than Y  ``

Sample Output 2

``X is equal to Y   ``

Sample Output 3

``X is less than Y  ``

## Solution – Comparing Numbers – HackerRank Solution

```#!/bin/bash
if (( \$X > \$Y ))
then
echo "X is greater than Y"
fi

if (( \$X == \$Y))
then
echo "X is equal to Y"
fi

if(( \$X < \$Y))
then
echo "X is less than Y"
fi
```

Note: This problem (Comparing Numbers) is generated by HackerRank but the solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.