C++ Program to Calculate Volume of a Cube using inline Function
Code:
Sample Output:
Comment bellow for your Query and Feedback
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();
}
#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
0 comments:
Confused? Feel free to ask
Post a Comment