## Discussion Forum

Interative Forum for discussing any query literally to UGC-NET Computer Science, GATE Computer Science and Computer Sciene and Technology in general.

## UGC-NET Computer Science

Correspondence Courses and Test Series to prepare for UGC-NET computer science and applications

## GATE

MCQs, Lecture Notes, Ebooks for GATE preparation

## Jobs Newsfeed

Timely information of various Recruitments.

NextPrev

## MCQs C++ |UGC-NET|GATE|Computer Science

 81. class circle { private : int radius ; public: circle ( int r = 0 ) { radius = r ; } } ; class rectangle { private : int length, breadth ; public : rectangle( int l, int b ) { length = l ; breadth = b ; } operator circle( ) { return circle ( length ) ; } } ; void main( ) { rectangle r ( 20, 10 ) ; circle c; c = r ; } A. 10 B. 20 C. 0 D. null View/Hide Ans Explanation 82. #include class date { private : int day ; int month ; int year ; public : date ( int d = 0, int m = 0, int y = 0 ) { day = d ;month = m ; year = y ; } date ( date &d ) { day = d.day ;month = d.month ; year = d.year ; } date operator = ( date d ) { day = d.day ; month = d.month ; year = d.year ; return d ;} void display( ) { cout << day << "/" << month << "/" << year ; } } ; void main( ) { date d1 ( 25, 9, 1979 ) ; date d2 = d1 ; date d3 ;d3 = d2 ;d3.display( ) ;} A. 25/9/1979 B. 9/25/1979 C. Empty String D. Compile Error View/Hide Ans Explanation 83. #include int func(int i); double func(double i); void main(void) { cout< A. 10 20 B. 20 10 C. 10 10.201 D. 10.201 10 View/Hide Ans Explanation 84. int area(int side){ return side*side;} int area(int l , int b){return l*b;} void main() { int (*p1)(int); int (*p2)(int,int); p1=area; p2=area; cout< A. 657 673 400 200 B. 657 673 200 200 C. 657 673 400 400 D. 657 673 200 400 View/Hide Ans Explanation 85. class arith { public: void calc(int num1){ cout< A. 36 42 B. 25 42 C. 42 25 D. 42 36 View/Hide Ans Explanation 86. #include class CDummy { public: int isitme (CDummy& param); }; int CDummy::isitme (CDummy& param) { if (¶m == this) return 1; else return 0; } int main () { CDummy a; CDummy* b = &a; if ( b->isitme(a) ) cout << "yes, &a is b"; return 0; } Output will be A. Blank screen B. yes, &a is b C. Error D. Compile error View/Hide Ans Explanation 87. #include class CDummy { public: static int n; CDummy () { n++; }; ~CDummy () { n--; }; }; int CDummy::n=0; int main () { CDummy a; CDummy b[5]; CDummy * c = new CDummy; cout << a.n << endl; delete c; cout << CDummy::n << endl; return 0; } A. 5 4 B. 6 5 C. 7 6 D. 8 7 View/Hide Ans Explanation

Author Does Not claim of any answer these answers are as per expert opinion

Pages: 1 2 3 4 5 6 7 8 9