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

Library Functions Questions and Answers

111.

The assert macro returns __________ value.

Answer: D

Correct answer: no

assert is a void macro: it returns nothing. If the condition holds it does nothing at all; if it fails it prints the expression, the file and the line and calls abort(). So it can never appear where a value is wanted.

Please log in or register to report this question.

112.

What error occurs if an input argument is outside the domain over which the mathematical function is defined?

Answer: A

Correct answer: domain error

A domain error occurs when an argument lies outside the set of values for which the function is defined - sqrt(-1) or asin(2). The function returns an implementation-defined value and sets errno to EDOM. A range error is the other case: the argument is fine but the result cannot be represented.

Please log in or register to report this question.

113.

Select the macro that affects the information provided by localeconv function.

Answer: C

Correct answer: LC_NUMERIC

localeconv() reports the numeric and monetary conventions, so it is governed by LC_NUMERIC - decimal point and thousands separator - and by LC_MONETARY for the currency fields. LC_COLLATE affects string comparison and LC_CTYPE character classification; neither shows up in the struct lconv.

Please log in or register to report this question.

Loading…
Tags: Library Functions Questions and Answers || Library Functions MCQ Questions and Answers || Library Functions GK Questions and Answers || Library Functions GK MCQ Questions || Library Functions Multiple Choice Questions and Answers || Library Functions GK || GK on Library Functions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming