Question
STATS 103-B Mathematical functions - 3 PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS! I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE.
STATS 103-B
Mathematical functions - 3
PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS!
I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE. THANKS
I WILL REPORT THOSE WHO WILL FLAG THIS!
READ COMMENTS FOR INSTRUCTIONS
6. What will be the output of the following C code?
double x=1.8; printf("%.2lf",floor(x));
a) 2.0
b) 2.00
c) 1.0
d) 1.00
7. double ______ (double x, double y) computes the floating-point remainder of x/y.
a) modf
b) fmod
c) ceil
d) floor
8. sqrt(x) function is not faster than the apparent equivalent pow(x,0.5).
a) true
b) false
9. Which of the given C function can be used instead of the apparent identity pointed to by y?
int x=1; double y= 0.5 * (exp (x) + exp (-x));
a) cos(x)
b) cosh(x)
c) fmod(x)
d) modf(x)
10. 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()
1. Which of the following statement is correct?
double x, y, z; x = 5.123456; z= modf(x, *y);
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 x
2. 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
3. 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
4. What will be the output of the following C code?
double x=1.2 printf("%.1lf", ceil(x));
a) 1
b) 2
c) 1.0
d) 2.0
5. What will be the output of the following C code?
double x=3,y= - 6; printf("%lf %lf", fabs(x), fabs(y));
a) 3 6
b) -3 6
c) 3.0 6.0
d) 3.000000 6.000000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started