C Programming/math.h/log

Logarithmic function in 'c' language

these functions are under math.h. In general log(x) i.e ln(x) and log10(x) these are two types of logarithm.In C language function is available for both of these. so that we can use mathematical terms effectively. log(x) is natural logarithm. log10 is base 10.

1.log/ln

double log (double x);
float log (double x);
long double log (long double x);

return value

return the natural logarithm of x. The natural logarithm is the base-e logarithm, the inverse of the natural exponential function.

#include <stdio.h>
#include <conio.h>
void main()
{

int num a,b,c,d;

clrscr();

scanf("%d",&a);

printf("\n\tsubtraction of 2");

scanf("%d",&b);

printf("\n\tmutiplication of 3");

scanf("%d",&c);

printf("\n\tdivide of 4");

scanf("%d",&d);

getch();

}

log10

double log10 (double x);
float log10 (double x);
long double log10 (long double x);

Return value'

compute common logarithm and return the common(base - 10) logarithm of x, where x>0.

example program

#include <stdio.h>
#include <math.h>
int main() {
double vrbl, result;
vrbl = 100;
result = log10 (vrbl);
printf("log10(%lf) = %lf\n", vrbl, result );
return 0;
}