main.go277 chars18 lines
In the above code, we first declare a variable num
with a value of 10. Then, we create an if
statement with a condition num > 10
. If the condition is true
, it prints "Number is greater than 10". If the condition is false
, the else if
statement is checked with the condition num < 10
. If the else if
condition is true
, it prints "Number is less than 10". Finally, if none of the above conditions are true
, the else
block gets executed and it prints "Number is equal to 10".
gistlibby LogSnag