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.
 
 
 
 

636 B

isnegative

Instructions

Écrire une fonction qui affiche 'T' (true) sur une seule ligne si l'int passé en paramètre est négatif, sinon elle affiche 'F' (false).

Fonction attendue

func IsNegative(nb int) {

}

Utilisation

Voici un éventuel programme pour tester votre fonction :

package main

import piscine ".."

func main() {
	piscine.IsNegative(1)
	piscine.IsNegative(0)
	piscine.IsNegative(-1)
}

Et son résultat :

student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test
F
F
T
student@ubuntu:~/piscine-go/test$