Sunday, 25 August 2013


C++ Program to Calculate Volume of a Cube using inline Function

Code:
/*C++ Program to Calculate Volume of a Cube using inline Function*/
#include<iostream.h>
#include<conio.h>
class line
{
  public:
 inline float multi(float a,float b)
   {
    return(a*b);
   }
  inline float cube(float a)
   {
    return(a*a*a);
   }
};
void main()
{
 line obj;
 float a1,b1;
 clrscr();
 cout<<"\n Enter Two Value ";
 cin>>a1>>b1;
 cout<<" Multiplication is :"<<obj.multi(a1,b1)<<endl;
 cout<<" Cube of val1 is :"<<obj.cube(a1)<<endl;
 cout<<" Cube of val2 is :"<<obj.cube(b1)<<endl;
 getch();
 }

Sample Output:


Comment bellow for your Query and Feedback

Related Posts :



0 comments:

Confused? Feel free to ask

Post a Comment