Posted in

C++ Program to display the cube of the number upto a given integer using Destructor

Write C++ Program to display the cube of the number upto a given integer using Destructor.

C++ Program to display the cube of the number upto a given integer

The destructor ~T4Tutorialst() is a member function of the class T4Tutorialst. Destructor  ~T4Tutorialst() has the same name as the name of its class T4Tutorialst. The tild sign ∼ is used before the name of the destructor ~T4Tutorials_Series().

  • When the object T4Tutorialst obj(p,q);of the class T4Tutorialst destroyed, then the destructor ~T4Tutorialst() also destroyed automatically.
  • One class T4Tutorialst can have only one destructor ~T4Tutorialst(). However, one class can have many constructors.
  • Destructor ~T4Tutorialst()overloading is impossible.
  • The Destructor ~T4Tutorialst()can’t have any arguments(parameters).
  • The destructor ~T4Tutorialst()has no data type.

Output

Please enter the number:

4

cube of 1 is: 1

cube of 2 is: 8

cube of 3 is: 27

cube of 4 is: 64

 CEO @ T4Tutorials.com
I welcome to all of you if you want to discuss about any topic. Researchers, teachers and students are allowed to use the content for non commercial offline purpose. Further, You must use the reference of the website, if you want to use the partial content for research purpose.

Leave a Reply

Contents Copyrights Reserved By T4Tutorials