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

**Task**

Given two integers,Â * X*Â andÂ

*, identify whetherÂ*

**Y****Â orÂ**

*X*<*Y***Â orÂ**

*X*>*Y**=*

**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Â

*, respectively).*

**Y****Constraints**

–

**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 read X read Y 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.