Thursday, 5 February 2015

C++ Programming for multiplication of two values using Inline function

C++ Programming for multiplication of two values using Inline function

#include<iostream.h>
#include<conio.h>
class Line
{
public:
inline float mult(float x,float y)
{
 return(x*y);
}
       };
void main()
{
 clrscr();
 Line obj;
 float val1,val2;
  cout<<"Enter two values for its Multiplication\n";
  cout<<"a= ";
  cin>>val1;
  cout<<"\nb= ";
  cin>>val2;
  cout<<"Multiplication of a and b is "<<obj.mult(val1,val2);
  getch();
 }

No comments:

Post a Comment