Skip to content

If Statements

Utku Melemetci edited this page May 17, 2024 · 1 revision

If statements can be used to check for equality between integers and booleans. Though equality between strings may compile, it is not supported.

func main() {
    let a = 1 + 2
    let b = 3 * 1
    if (a == b) {
        std::print_string("equal")
    }
}
Clone this wiki locally