Question
Problem Statement: Write a C program that shows one example output for each of the math library function calls shown in Fig 5.2. (Hint: This
Problem Statement: Write a C program that shows one example output for each of the
math library function calls shown in Fig 5.2.
(Hint: This program is already shown in the text C How to Program chapter 5 as answer to
self
-review exercise#5.3.
Please write your own printf construct in your program, and not the same
construct as shown in
Text.)
Please include:
1) title comment of what the program does at the very top of program 2) comment to explain each variable used within program unless the name suggests its meaning 3) comment for each for loop or if-else or while construct what the construct does within the program
Note to find this book, it is availiable as a pdf by simply googling the title.
sqrt(x square root ofx sqrt( 900.0 is 30.0 sqrt ( 9.0 )is 3.0 cbrt( x cube root ofx (C99 and C11 only) cbrt( 27.0 is 3.0 cbrt( -8.0) s-2.0 exp( x) logC x) log100 x exp( 1.0 )is 2.718282 exp( 2.0 )is 7.389056 logC logC log10 exponential function e natural logarithm of x (base e) is 1.0 is 2.0 2.718282 .389056 logarithm ofx (base 10) is 0.0 log10( 10.0 ) is 1.0 100.0 log10 is 2.0 ) is 13.5 absolute value of x as a floating-point fabs number fabs( x 13.5 fabsC 0.0is 0. fabs cei 1 ( 9 . 2 ceil( floor floor 13.5 is 13.5 ceil(x rounds x to the smallest integer not less ) is 10.0 than x 9.8 ) is-9.0 floor(x) rounds x to the largest integer n greater thanx is 9.0 ) is-10.0 9.2 9.8 pow( 2, 7 ) is 128.0 pow( 9, .5 )is 3.0 pow( x, y xraised to power y (e) fmodC x, yremainder of xly as a floating-point fmod 3.657, 2.333 is 1.992 number sinx cos( x tan( x) trigonometric sine of x (x in radians) sin .0is O0 trigonometric cosine of x (x in radians) cos 0.0is 1o trigonometric tangent ofx (x in radians) tan( 0.0 ) is 0.0 Fig. 5.2 | Commonly used math library functionsStep 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