Thursday, December 30, 2010

Inline Function

#include<iostream.h>

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

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

int main()
{
  float a=12.345;
  float b=9.82;

  cout<<mul(a,b)<<"\n";
  cout<<div(a,b)<<"\n";
  return 0;
}
Output--->

No comments: