Anonymous
public text v1 · immutable#include <stdio.h>
#include <math.h>
float LOG2 (float x) {
return(log10(x)/log10(2.0));
}
main () {
float x;
printf("Please enter a float: ");
scanf("%f", &x);
printf("The base two logarithm of %f is %f\n", x, LOG2(x));
printf("Please enter a real number: ");
scanf("%f", &x);
printf("The base two logarithm of %f is %f\n", x, LOG2(x));
printf("Please enter a real number: ");
scanf("%f", &x);
printf("The base two logarithm of %f is %f\n", x, LOG2(x));
}