Aim: To implement program to calculate area of cube using inline function.
Code:
inline void area_cube(float side)
{
float area;
area=6*side*side;
cout<<"\nArea of cube with side "<
}
void main()
{
int side;
clrscr();
cout<<"Program to calculate area of Cube:";
cout<<"\n Enter side of cube:";
cin>>side;
area_cube(side);
getch();
}
Output:
Program to calculate area of Cube:
Enter side of cube:7
Area of cube with side 7 cm is 294 cm²