Premier Technology Group: Test Paper (C & C++) No. of Questions: 25 Duration: 30 MIN
Premier Technology Group: Test Paper (C & C++) No. of Questions: 25 Duration: 30 MIN
Premier Technology Group: Test Paper (C & C++) No. of Questions: 25 Duration: 30 MIN
INSTRUCTIONS :
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
4.
------------------------- is a class of which one can not create objects.
5.
------------------ is a member function of a class which gets automatically executed when instance of a class gets
destroyed.
6.
Is it possible to overload operator == so that it compare two char[] using a string comparison?
1. Yes
2. No
7. From the following list what are operators which can’t be overloaded?
I. ()
II. [ ]
III. sizeof
IV. ::
1) III & I
2) III & II
3) III & IV
4) All
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
1) 100
2) 101
3) compilation error
4) None of these
1) 100
2) 10
3) data of constant object can not be changed.
4) None of these
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
11. What will be output of the following program?
class MyBaseClass
{
public :
int val;
.......
};
class MyDerivedClass : MyBaseClass
{ .......
};
14. What is the difference between keyword struct and keyword class?
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
1) Will give compilation error.
2) In derived.
3) In base.
4) Will compile with warning on typecasting and will give output as In base class.
18. In the following code, when will the function return the value 1?
int MyFunc ( char ch )
{
int nVal = 0;
if ( ch == 0x80 )
nVal++;
return nVal;
}
1) I 2) II 3) III 4) IV
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
4) None of these
1) WorldHello
2) Hi There
3) Hello World
4) None of these
22.
#define MULTIPLY ( A, B ) A* B
int i, j;
i = j = 2;
printf ( “%d”, MULTIPLY ( i + 1, j + 1 ) );
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.
PREMIER TECHNOLOGY GROUP
void main ( void )
{
MyGrandChild *ptr = new MyGrandChild;
ptr->Display ( );
}
1) In Parent
2) In Child1
3) In Child2
4) Compilation error
148, Thaper Enclave, Ramdaspeth, Nagpur – 440010. Tel.: 91-712-546179, 546734 Fax: 555820.
Email : [email protected]
Proprietary and confidential – DO NOT COPY – © 2000 PTGPL.