πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!


    Question

    Which of the following is the syntax for an `if`

    statement checking if a variable `NUM` is numerically equal to 5?
    A `if [ $NUM == 5 ]; then ... fi` Correct Answer Incorrect Answer
    B `if ($NUM = 5) then ... end if` Correct Answer Incorrect Answer
    C `if [ $NUM -eq 5 ]; then ... fi` Correct Answer Incorrect Answer
    D `if $NUM -eq 5 then ... fi` Correct Answer Incorrect Answer
    E None of these Correct Answer Incorrect Answer

    Solution

    `if [ $NUM -eq 5 ]; then ... fi`

    Practice Next
    ask-question