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.
 
 
 
 
 
 
zainabdnaya 7446208834 corrected 2 years ago
..
README.md corrected 2 years ago

README.md

isnegative

Write a function named IsNegative() that defines if a number (You should check if it's a number) is negative or positive.

  • Your function print P if the number is positive
  • Your function print F if the number is negative
  • For the number is zero print 0.
  • If it's not a number print newline.
  • Your program should always print ('\n') at the end of the output.

Expected function

func StrisNegative(str string) {

}

Usage

Here is a possible program to test your function :

package main

func main() {
	StrisNegative("585")
	StrisNegative("-58")
	StrisNegative("55s44")
	StrisNegative("101-1331")
	StrisNegative("5544-")
}

And its output :

$ go run .
P
N
!
!
!