Skip to content

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!