Write a program using class and object using C++
Answers
Answered by
0
Answer:
Explanation:
Programiz
Search Programiz
C++ Classes and Objects
In this tutorial, we will learn about objects and classes and how to use them in C++ with the help of examples.
In previous tutorials, we learned about functions and variables. Sometimes it's desirable to put related functions and data in one place so that it's logical and easier to work with.
Suppose, we need to store the length, breadth, and height of a rectangular room and calculate its area and volume.
To handle this task, we can create three variables, say, length, breadth, and height along with the functions calculateArea() and calculateVolume().
Similar questions