Computer Science, asked by anish1801, 1 year ago

Write a program in C to show use of differ constructors in a class.

Answers

Answered by aashi2701
0
Constructor has the same name as that of the class and it does not have any return type. Also, the constructor is always public.
... .. ... class temporary { private: int x; float y; public: // Constructor temporary(): x(5), y(5.5) { // Body of constructor } ... .. ... }; int main() { Temporary t1; ... .. ... }

thanks
hope you like it
please mark as a brainliest answer

anish1801: thats the question! can you help me writing the programme?
anish1801: I asked for a single program using different constructors!
Similar questions