McqMate
Login
Register
Home
Search
Login
Register
Computer Science Engineering (CSE)
CPP Programming
Constructors have _____ return type.
Q.
Constructors have _____ return type.
A.
void
B.
char
C.
int
D.
no
Answer» D. no
View all MCQs in:
CPP Programming
Discussion
Comment
Related Questions
Which of the following is true about constructors? 1) They cannot be virtual. 2) They cannot be private. 3) They are automatically called by new operator.
For automatic objects, constructors and destructors are called each time the objects
Output of the program? #include<iostream> using namespace std; int fun(int x = 0, int y = 0, int z) { return (x + y + z); } int main() { cout << fun(10); return 0; }
Output of following program? #include <iostream> using namespace std; int fun(int=0, int = 0); int main() { cout << fun(5); return 0; } int fun(int x, int y) { return (x+y); }
Implicit return type of a class constructor is:
Return type of uncaught_exception () is ________________.
Output of following program? #include<iostream> using namespace std; class Point { Point() { cout << "Constructor called"; } }; int main() { Point t1; return 0; }
#include<iostream> using namespace std; class Point { public: Point() { cout << "Constructor called"; } }; int main() { Point t1, *t2; return 0; }
Output of following C++ program? #include<iostream> using namespace std; int main() { int x = 10; int& ref = x; ref = 20; cout << "x = " << x << endl ; x = 30; cout << "ref = " << ref << endl; return 0; }
Predict the output of following C++ program. #include<iostream> using namespace std; class Empty {}; int main() { cout << sizeof(Empty); return 0; }
Login to Continue
It will take less than 2 minutes
Continue with Google
Continue with Linkedin
Continue with Twitter
Report MCQ
Remark*
Report