HackerRank - Getting started with conditionals

April - 25/2025

Problem:

Read in one character from STDIN.

# Input

# Output

# Solution

            
    read char
  
    if [ $char == "Y" ] || [ $char == "y" ]; then
        echo "YES"
    elif [ $char == "N" ] || [ $char == "n" ]; then
        echo "NO"
    else
        echo "No other character will be provided as input."
    fi 
        

# Solution_01

            
    read i
    if [ $i = "y" ] || [ $i = "Y" ]; then
        echo "YES"
    else
        echo "NO"
    fi 
        

Post: