C++ Programming Code Examples C++ > Beginners Lab Assignments Code Examples Simple Program for Inline Function Using C++ Programming Simple Program for Inline Function Using C++ Programming Inline Function Definition In various versions of the C and C++ programming languages, an inline function is a function upon which the compiler has been requested to perform inline expansion. In other words, the programmer has requested that the compiler insert the complete body of the function in every place that the function is called, rather than generating code to call the function in the one place it is defined. Compilers are not obligated to respect this request. To write a program to find the multiplication values and the cubic values using inline function. #include<iostream.h> #include<conio.h> class line { public: inline float mul(float x, float y) { return (x * y); } inline float cube(float x) { return (x * x * x); } }; void main() { line obj; float val1, val2; clrscr(); cout << "Enter two values:"; cin >> val1>>val2; cout << "\nMultiplication value is:" << obj.mul(val1, val2); cout << "\n\nCube value is :" << obj.cube(val1) << "\t" << obj.cube(val2); getch(); }