Engineering :: All Aptitude Test ::

Hassan
1.Which of the following cannot be used with the virtual keyword ?
A. Class
B. Member functions
C. Constructors
D. Class

2.Which concept is used to implement late binding ?
A. Virtual functions
B. Operator functions
C. Constant functions
D. Virtual functions

3.Which of the following is correct ?
A. C++ allows static type checking
B. C++ allows dynamic type checking.
C. C++ allows static member function to be of type const.
D. C++ allows static type checking

4.Which of the following supports the concept that re-usability is a desirable feature of a language ?
A. It reduces the testing time
B. It reduces maintenance cost
C. It decreases the compilation time
D. It reduces the testing time

5.Which of the following is a static polymorphism mechanism ?
A. Function overloading
B. Operator overloading
C. Templates
D. Function overloading

6.Which of the following is not a type of inheritance ?
A. Multiple
B. Multilevel
C. Distributive
D. Multiple

7.What happens if a class does not have a name ?
A. It will not have a constructor
B. It will not have a destructor
C. It is not allowed
D. It will not have a constructor

8.Which members are inherited but are not accessible in any case ?
A. Private
B. Public
C. Protected
D. Private

9.Which of the following is correct ?
A. Friend functions can access public members of a class
B. Friend functions can access protected members of a class
C. Friend functions can access private members of a class
D. Friend functions can access public members of a class

10.Which of the following is correct in C++ ?
A. Classes cannot have protected data members
B. Structures can have member functions
C. Class members are public by default
D. Classes cannot have protected data members

11.Which of the following is used to make an abstract class ?
A. By using virtual keyword in front of a class declaration
B. By using an abstract keyword in front of a class declaration
C. By declaring a virtual function in a class
D. By using virtual keyword in front of a class declaration

12.Which of the following is correct ?
A. A class is an instance of its objects
B. An object is an instance of its class
C. A class is an instance of the data type that the class have
D. A class is an instance of its objects

13.Which operator is overloaded for a cout object ?
A. >>
B. <<
C. <
D. >>

14.Which of the following cannot be used with the virtual keyword ?
A. Class
B. Member functions
C. Constructors
D. Class

15.Which concept is used to implement late binding ?
A. Virtual functions
B. Operator functions
C. Constant functions
D. Virtual functions

16.Which of the following is correct ?
A. C++ allows static type checking
B. C++ allows dynamic type checking.
C. C++ allows static member function to be of type const.
D. C++ allows static type checking

17.Which of the following supports the concept that re-usability is a desirable feature of a language ?
A. It reduces the testing time
B. It reduces maintenance cost
C. It decreases the compilation time
D. It reduces the testing time

18.Which of the following is a static polymorphism mechanism ?
A. Function overloading
B. Operator overloading
C. Templates
D. Function overloading

19.What is the correct syntax of declaring array of pointers of integers of size 10 in C++ ?
A. int arr = new int[10];
B. int **arr = new int*[10];
C. int *arr = new int[10];
D. int arr = new int[10];

20.What will be the output of the following C++ code ?
A. 5
B. Garbage value
C. Compile-time error
D. 5

21.What happens if a pointer is deleted twice in a program as shown in the following C++ statements ?
A. Undefined behavior
B. Syntactically incorrect
C. Semantically incorrect
D. Undefined behavior

22.Correct way to define a value 6.28 in a variable ‘pi’ where value cannot be modified ?
A. #define pi 6.28F
B. pi = 6.28F
C. const float pi = 6.28F
D. #define pi 6.28F

23. Minimum and Maximum range of values supported by ‘float’ data type are ?
A. 1.5 * 10-40 to 3.4 * 1038
B. 1.5 * 10-45 to 3.4 * 1030
C. 1.5 * 10-45 to 3.4 * 1038
D. 1.5 * 10-40 to 3.4 * 1038

24.Why does a float variable stop increment at number ‘16777216’ in the following C# code ?
A. Sign and Exponent for ‘16777217’ is same as for ‘16777216’
B. Mantissa is different for ‘16777216’ and ‘16777217’
C. Sign and Exponent for ‘16777217’ is different from ‘16777216’
D. Sign and Exponent for ‘16777217’ is same as for ‘16777216’

25.What will be the output of the following C# code?
A. 0.4000004
B. 0.4000023
C. 0.0400021
D. 0.4000004

26.The Default value of Boolean Data Type is ?
A. True
B. 0
C. False
D. True

27.What will be the output of the following C# code ?
A. 1
B. NaN
C. 0
D. 1

28.Which of the below statements is equivalent to $add += $add ?
A. $add = $add
B. $add = $add +$add
C. $add = $add + 1
D. $add = $add

29.Which statement will output $x on the screen ?
A. echo “\$x”;
B. echo “$$x”;
C. echo “/$x”;
D. echo “\$x”;

30.What will be the output of the following PHP code ?
A. 123
B. 111
C. 000
D. 123


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers