We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
If statements are used to conditionally execute a block of code
if condition { // ... }
if(condition){ // ... }
if condition, // ...
if condition // ...
if(condition) // ...
if(condition), // ...
If the condition is true, then the code inside the block will be executed
true
If the condition is false, then other code can be executed instead by specifying an else block
false
else
else { // ... }
} else { // ... }
else // ...
else if // ...
elif // ...
import basics func main { age int = scanInt("How old are you? ") if age >= 18 { print("You are an adult") } else { print("You are a child") } }
Table of Contents