You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

686 B

sqrt

Intructions

Écrire une fonction qui renvoie la racine carré d'un int passé en paramètre as parameter si cette racine carré est un nombre entier. Autrement elle renvoie 0.

Fonction attendue

func Sqrt(int nb) int {

}

Utilisation

Voici un éventuel programme pour tester votre fonction :

package main

import (
        "fmt"
        piscine ".."
)

func main() {
	arg1 := 4
	arg2 := 3
	fmt.Println(piscine.Sqrt(arg1))
	fmt.Println(piscine.Sqrt(arg2))

}

Et son résultat :

student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
2
0
student@ubuntu:~/piscine/test$