Explore topic-wise MCQs in C Multiple Choice.

This section includes 28 Mcqs, each offering curated multiple-choice questions to sharpen your C Multiple Choice knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the given function is a library function under the header math.h?

A. log10()
B. log20()
C. log30()
D. log50()
Answer» B. log20()
2.

The ldexp() function multiplies a floating-point number by an integral power of 2.

A. true
B. false
Answer» B. false
3.

What does the given C code do?

A. The atan2 function returns the arc tangent of x/y
B. The atan2 function returns the arc tangent of x
C. The atan2 function returns the arc tangent of y/x
D. The atan2 function returns the arc tangent of yView Answer
Answer» D. The atan2 function returns the arc tangent of yView Answer
4.

Which function is used to recombine the fraction and exponent parts of a floating-point value after you have worked on them separately?

A. frexp()
B. exp()
C. modf()
D. Idexp()
Answer» E.
5.

Which of the given C function can be used instead of the apparent identity pointed to by y?

A. cos(x)
B. cosh(x)
C. fmod(x)
D. modf(x)View Answer
Answer» C. fmod(x)
6.

sqrt(x) function is not faster than the apparent equivalent pow(x,0.5).

A. true
B. false
Answer» C.
7.

double ______ (double x, double y) computes the floating-point remainder of x/y.

A. modf
B. fmod
C. ceil
D. floor
Answer» C. ceil
8.

A domain error occurs if x is negative and y is not an integral value for the function pow(double x, double y).

A. true
B. false
Answer» B. false
9.

Which of the following statement is correct?

A. y stores integer part of x, z returns fractional part of x
B. y stores integer part of x, z returns integer part of x
C. y stores fractional part of x, z returns integer part of x
D. y stores fractional part of x, z returns fractional part of xView Answer
Answer» B. y stores integer part of x, z returns integer part of x
10.

WHICH_FUNCTION_RETURNS_THE_ARC_SINE_IN_THE_RANGE_[-PI/2,_+PI/2]_RADIANS??$

A. arcsin()
B. asin()
C. sin()
D. asine()
Answer» B. asin()
11.

range erro?

A. domain error
B. no error
C. domain and range error
Answer» C. domain and range error
12.

The function computes the exponential function of x.

A. exp(x)
B. frexp(x)
C. frexp x
D. exp x
Answer» B. frexp(x)
13.

If the result underflow, the function returns zero.

A. true
B. false
Answer» B. false
14.

Name the function that breaks a floating-point number into a normalized fraction and an integral power of 2.

A. exp()
B. frexp()
C. Idexp()
D. modf()
Answer» E.
15.

If the result overflows, the function returns the value of the macro HUGE_VAL, carrying the same sign except for the_________ function as the correct value of the function.

A. sin
B. cos
C. cosec
D. tan
Answer» E.
16.

Which of the following is the correct code?

A. tanh(double x)
B. tanh double x
C. tanhdouble x
D. tanhdoublex
Answer» C. tanhdouble x
17.

A range error occurs if the result of the function cannot be represented as a value.

A. int
B. short int
C. double
D. float
Answer» D. float
18.

What error occurs if the magnitude of x is too large in sinh(double x)?

A. domain error
B. range error
C. no error
D. zero is returned
Answer» B. range error
19.

A function is declared as sqrt(-x) under the header file math.h, what will the function return?

A. square root of x
B. complex number
C. domain error
D. range error
Answer» E.
20.

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

A. domain error
B. range error
C. no error
D. domain and range error
Answer» B. range error
21.

The function computes the hyperbolic cosine of x.

A. cos(x)
B. cosine(x)
C. cosh(x)
D. cosineh(x)
Answer» C. cosh(x)
22.

What will cos(x) return?

A. sine of x where x is in radians
B. sine of x where x is in degree
C. cosine of x where x is in radians
D. cosine of x where x is in degree
Answer» B. sine of x where x is in degree
23.

HUGE_VAL macro is used when the output of the function may not be ___________

A. floating point numbers
B. integer number
C. short int
D. long int
Answer» B. integer number
24.

y stores integer part of x, z returns fractional part of x

A. y stores integer part of x, z returns integer part of x
B. y stores fractional part of x, z returns integer part of x
C. y stores fractional part of x, z returns fractional part of x
Answer» B. y stores fractional part of x, z returns integer part of x
25.

What will sin(x) returns?

A. sine of x where x is in radians
B. sine of x where x is in degree
C. cosine of x where x is in radians
D. cosine of x where x is in degree
Answer» D. cosine of x where x is in degree
26.

All the functions in this library take as a parameter and return as the output.

A. double, int
B. double, double
C. int, double
D. int, int
Answer» C. int, double
27.

The cos function computes the cosine of x.

A. measured in radians
B. measured in degrees
C. measured in gradian
D. measured in milliradian
Answer» D. measured in milliradian
28.

The atan2 function returns the arc tangent of x/y

A. The atan2 function returns the arc tangent of x
B. The atan2 function returns the arc tangent of y/x
C. The atan2 function returns the arc tangent of y
Answer» B. The atan2 function returns the arc tangent of y/x