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 () ;    
    }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|