Question: Must look exactly like example. Concepts to Practice User-written functions math.h Description For the prelab assignment, you are to write a function called log16() to


Must look exactly like example.
Concepts to Practice User-written functions math.h Description For the prelab assignment, you are to write a function called log16() to calculate the logarithm base 16 of a number. You may call any function from math.h such as log() or log10() in your implementation of log16(). In your main(), you should loop through powers of 2 starting at 1 (which is 29) up through 4096 and print these numbers along with their log16() - see sample output below. If (like me) you need a refresher on how to convert logarithms, here is some info from Purple Math (https://www.purplemath.com/modules/logrules5.htm): In order to evaluate a non-standard-base log, you must use the Change-of-Base formula: Change-of-Base Formula: log (2) logo (W) = loga(6) Functions You Must Write You may write any functions you wish to implement this program, in addition to the following functions. However, you must implement the following functions: double log16(double x) This function returns the log base 16 of x. int main(void) Of course, you need to write a main(). Hints You should print double numbers with %lf as the formatter. Sample Output jimr@JimRHadesCanyon:~/CS1050/SP2020/labs/lab4$ compile prelab4.c jimr@JimRHadesCanyon :~/CS1050/SP2020/labs/lab4$ ./a.out Log base 16 of 1 = 0.000000 Log base 16 of 2 = 0.250000 Log base 16 of 4 = 0.500000 Log base 16 of 8 = 0.750000 Log base 16 of 16 = 1.000000 Log base 16 of 32 = 1.250000 Log base 16 of 64 = 1.500000 Log base 16 of 128 = 1.750000 Log base 16 of 256 = 2.000000 Log base 16 of 512 = 2.250000 Log base 16 of 1024 = 2.500000 Log base 16 of 2048 = 2.750000 Log base 16 of 4096 = 3.000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
