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

PHP Star Triangle pattern program

PHP Star Triangle pattern program In this tutorial, we will discuss about PHP Star Triangle…

6 months ago

PHP Full Pyramid pattern program

PHP Full Pyramid pattern program In this tutorial, we will discuss about PHP Full Pyramid…

6 months ago

5 methods to add two numbers in Java

5 methods to add two numbers in Java In this tutorial, we will discuss the…

6 months ago

Python Full Pyramid star pattern program

Python full Pyramid star pattern program In this tutorial, we will discuss  the concept of…

9 months ago

Write a function or method to convert C into F -Entered by user

Write a function or method to convert C into F -Entered by the user In…

1 year ago

How to write a function or method to convert Celsius into Fahrenheit

How to write a function or method to convert Celsius into Fahrenheit In this tutorial,…

1 year ago