Explanation of If statement to display results based on varying inputs