Program to illustrate the log ( ) and log10 ( ) function

/* Program to illustrate the log ( ) function */
    #include <iostream.h>
    #include <math.h>                      // defines the log ( ) function
      #include <conio.h>
       void main ( )
    {
            double result;
        double x = 0.5 ;
        result = log ( x ) ;
        cout<<" \n The natural log of  "<< x <<" is "<<result ;
        getch () ;    
    }
-----------------------------------------------

/* Program to illustrate the log10 ( ) function */
    #include <iostream.h>
    #include <math.h>                      // defines the log10 ( ) function
    #include <conio.h>
      void main ( )
    {
            double result;
        double x = 10 ;
        result = log10( x ) ;
        cout<<" \n The natural log of  "<< x <<" is "<<result ;
        getch () ;    
    }

No comments:

Post a Comment