0% found this document useful (1 vote)
548 views

WAP To Write A Program To Find The Multiplication Values and The Cubic Values Using Inline Function

The document defines a C++ class called "line" that contains two inline member functions: mul() that returns the multiplication of two float values passed in, and cube() that returns the cube of a float value passed in. The main() function declares an instance of the line class, gets two float values from the user, calls the mul() function to output the multiplication of the values, and calls cube() twice to output the cubes of each value separately.

Uploaded by

9y9a
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
548 views

WAP To Write A Program To Find The Multiplication Values and The Cubic Values Using Inline Function

The document defines a C++ class called "line" that contains two inline member functions: mul() that returns the multiplication of two float values passed in, and cube() that returns the cube of a float value passed in. The main() function declares an instance of the line class, gets two float values from the user, calls the mul() function to output the multiplication of the values, and calls cube() twice to output the cubes of each value separately.

Uploaded by

9y9a
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

#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 getch(); } :"<<obj.cube(val1)<<"\t"<<obj.cube(val2);

You might also like