OOPc using C++

With this blog I want to share my knowledge of OOPs and C++. I Hope this can quench your thirst for learning.Any suggestions and comments are welcome.

Wednesday, August 4, 2010

Program 7 - Inline Functions

#include<iostream.h>


inline float mul(float x,float y)
{
               return(x*y);
}


inline double div(double p,double q)
{
              return(p/q);
}


int main( )
{
            float a = 12.345;
            float b =  9.82;
        
            cout<<mul(a,b)<<endl;
            cout<<div(a,b)<<endl;


           return 0;
}
    
Output:
121.228
1.25713    


Click here to read about Inline Functions







No comments:

Post a Comment