# If Statements

## If-statement syntax

```fsharp
if <expr> {
    <if statement body>
}
elif <expr> {
    <else if statement body>
}
else {
    <else statement body>
}
```

## Working Example

{% tabs %}
{% tab title="Gauntlet" %}

```fsharp
package main

import "fmt" as fmt


fun main(): Unit {
  let isInRelationship = false
  let isProgrammer = true
  if isProgrammer && !isInRelationship {
    fmt.println("Makes sense")
  }
  elif !isProgrammer && isInRelationship {
    fmt.println("Makes sense")
  }
  elif !isProgrammer && !isInRelationship {
    fmt.println("It's ok, it won't be hard for you to find a relationship")
  }
  else {
    fmt.println("Stop lying")
  }
}
```

{% endtab %}

{% tab title="Transpiled" %}

```go
package main

import fmt "fmt"

func main() {
	isInRelationship := false
	isProgrammer := true
	if isProgrammer && !isInRelationship {
		fmt.Println("Makes sense")
	} else if !isProgrammer && isInRelationship {
		fmt.Println("Makes sense")
	} else if !isProgrammer && !isInRelationship {
		fmt.Println("It's ok, it won't be hard for you to find a relationship")
	} else {
		fmt.Println("Stop lying")
	}
	// Eliminates any 'unused variable' errors
	_, _ = isInRelationship, isProgrammer

}

```

{% endtab %}

{% tab title="Output" %}

```
Makes sense
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gauntletlang.gitbook.io/docs/if-statements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
