In this tutorial, we will discuss about log10 Arithmetic function in C Language
In the C programming language, the log10() Arithmetic function in C Language returns the logarithm of x to the base of 10
log10(): In C programming Language,log10() function is use to perform calculate natural logarithm
The Syntax for the log10() Arithmetic function in the C Language is
double log10(double x);
x is the parameter or argument of this function used to calculate the logarithm of x to the based of 10
The log10() function returns the logarithm of value to the base of 10
In C Language,the required header file for log10() function is
#include<math.h>
The example shows usage of the log10() function
Program 1
#include <stdio.h> #include <math.h> int main() { double x,y; x=1.5; y=2.5; printf("log10 value of %f is: %f\n",x,log10(x)); printf("log10 value of %f is: %f",y,log10(y)); getch(); return 0; }
When we compile above program,it will produce the following result
log10 value of 1.500000 is: 0.176091
log10 value of 2.500000 is: 0.397940
Program 2
#include <stdio.h> #include <math.h> int main() { //define temporary variable double value1; double result; printf("Enter the number for value1 :"); //get input from user scanf("%lf",&val1); //calculate log10 result=log10(val1); //Display log10 value printf("log10 value of %lf is: %lf\n",value1,result); getch(); return 0; }
When we compile above program, it will produce the following result
Enter the number for value1 :1.5 log10 value 0f 1.500000 is :0.176091
Similar Functions
Other C programming language functions that are similar to the cosine function
suggested for you
User defined function in C language
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
Program to count vowels, consonants, words, characters and space in Java In this article, we…
How to print multiplication table using Array in C++ language In this post, we will…
C Program to multiplication table using Array In this tutorial , we will discuss about…
Java program to check odd or even using recursion In this tutorial, we discuss a…