The value exists

Report a typo

It's one of the common tasks of development — check if the value exists. You get an int value by the input. You need to convert the input value to the bool variable and print it. Let's agree that an int value exists if the value is non-zero.

Tip: You can compare an input value with a zero and put a result to a variable.

Sample Input 1:

1

Sample Output 1:

true
Write a program in Go
package main

import "fmt"

func main() {
var number int
fmt.Scan(&number)

result := ?

fmt.Println(result)
}
___

Create a free account to access the full topic