function in C

log10 Arithmetic function in C Language

log10 Arithmetic function in C Language

In this tutorial, we will discuss about  log10 Arithmetic function in C Language

Description

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

 

Declaration

The Syntax for the log10() Arithmetic function in the C Language is

double log10(double x);

Parameters or Arguments

x is the parameter or argument of this function used to calculate the logarithm of x to the based of 10

 

Return value

The log10() function returns the logarithm of value to the base of 10

 

Required Header

In C Language,the required header file for log10() function is

#include<math.h>

Example

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      

cosh function   in C  language                               

sinh function in C language

tanh function in C language

abs function in C language

floor function in C language

ceil function in C language

round function in C language

sqrt function in C language

pow function in C language

exp function in C language

log function in C language

log10 function in C language

trunc function in C language

 

 

suggested for you

Function in C language

User defined function in C language

Arithmetic functions in C Language

String function in C language

sqrt function in C programming language
log function in C programming language
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

2 months ago

Java program to check odd or even using recursion

Java program to check odd or even using recursion In this tutorial, we discuss a…

2 months ago