|
|
An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
The syntax of an if...else statement in Go programming language is:
The if block of code is executed, if the Boolean expression evaluates true, otherwise else block of code will be executed.
The above code is compiled and executed, the result produced appears as -
An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement.
When using if , else if , else statements there are few points to keep in mind:
The syntax of an if...else if...else statement in Go programming language is:
The above code is compiled and executed; the result produced appears as -
|
|
Go (programming language) Related Tutorials |
|
---|---|
Linux Tutorial | Lisp programming Tutorial |
F Sharp (programming language) Tutorial | Computer Programming Tutorial |
D Programming Language Tutorial | Lua (programming language) Tutorial |
Windows 10 Tutorial |
Go (programming language) Related Practice Tests |
|
---|---|
Linux Practice Tests | Basic Programming Practice Tests |
Mac OS X Deployment Practice Tests | Mac OS X TroubleShooting Practice Tests |
Lisp programming Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.