The C log10 function is one of the Math Function, used to calculate the logarithmic value of a number with base 10.

In this article we will show you, How to write a log10 function in C Programming language with example.

## log10 syntax

The basic syntax of the math log10 inĀ C Programming is as shown below.

double log10(double number);

## C log10 Function Example

The math log10 Function allows you to find the logarithmic value of base 10. In this program, We are going to find same, and display the output.

/* LOG10 in C Programming Example */ #include <stdio.h> #include <math.h> int main() { printf("\n The Logarithmic Value of 0 base 10 = %.4f ", log10(0)); printf("\n The Logarithmic Value of 1 base 10 = %.4f ", log10(1)); printf("\n The Logarithmic Value of 15 base 10 = %.4f ", log10(15)); printf("\n The Logarithmic Value of 29.3 base 10 = %.4f ", log10(29.3)); printf("\n The Logarithmic Value of -6.32 base 10 = %.4f ", log10(-6.32)); printf("\n The Logarithmic Value of -14.4 base 10 = %.4f ", log10(-14.4)); return 0; }

**OUTPUT**

## C log10 Example 2

In this example, we are allowing the user to enter their own value. Next, we used log10 function to find the logarithmic value of user given number with base 10.

/* LOG10 in C Programming Example */ #include <stdio.h> #include <math.h> int main() { float number, logValue; printf(" Please Enter any Numeric Value : "); scanf("%f", &number); logValue = log10(number); printf("\n Logarithmic Value of %.2f base 10 = %.4f ", number, logValue); return 0; }

**OUTPUT**