Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which statement is true regarding abs() and labs()?

  • A.The abs() function is similar to the labs() function, except that the argument and the returned value each of them have type long int
  • B.The abs() function is not similar to the labs() function, except that the argument and the returned value in both functions have type long int
  • C.The abs() function is similar to the labs() function, except that the argument and the returned value each have type short int
  • D.The abs() function is not similar to the labs() function, except that the argument and the returned value in both function have type short int

Answer: A

Correct answer: The abs() function is similar to the labs() function, except that the argument and the returned value each of them have type long int

The two do the same thing for different types: abs takes and returns an int, and labs takes and returns a long int. (llabs was added for long long, and fabs handles floating point.)

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.