+ 3
Learn about constructor and destructor
write a function called power(n , p) which takes double value for n and int value for p and returns a result as a double value.use a default argument of 2 for p.write a main() function that gets the value from user.use appropriate constructor and destructor.
3 ответов
+ 1
No constructor or destructor is needed in this coding question. Is there any more information? I presume it's C++.
+ 1
Ya,not needed right but i try to solbe this with constructor and destructor for the practice
+ 1
You can use a constructor to set the object values, n and p
But no need for deconstructor you don't need the allocate memory so no deconstructor