Searching for: Output in Go
Used to output text directly to the console.
Write to FIle
Used to create and write characters to a file.
The if else block controls decision making by checking true/false statements resulting in different executions of code, depending on if the result is true and if the result is false. There are three parts to the if-else block: if, else if, and else.
The while loop executes a block of code while a boolean expression evaluates to true. It terminates as soon as the expression evaluates to false. The boolean expression is evaluated before each iteration. Instead of using the 'while' keyword, it uses the 'for' keyword with only a Boolean expression. There is no do-while loop in Go.
Next Page >