Futuresoft Previous Years Solved Sample Placement Papers
-
What is the error in the following code?
class t { virtual void print(); }
A: No error
B: Function print() should be declared as static.
C: Function print() should be defined.
D: Class t should contain data members.
Ans: A -
It is possible to declare as a friend
A: A member function
B: A global function
C: A class
D: All of the above
Ans: D -
What is the output of the following code
char symbol[3] = {'a', 'b', 'c'}; for (int index = 0; index < 3; index++) cout << symbol[index];
A: a b c
B: "abc"
C: abc
D: 'abc'
Ans: C -
Identify the operator that is NOT used with pointers
A: ->
B: &
C: *
D: >>
Ans: D -
Overloading a postfix increment operator by means of a member function takes
A: No argument
B: One argument
C: Two arguments
D: Three arguments
Ans: A -
Which of the following is not the characteristic of constructor?
A: They should be declared in the public section.
B: They do not have return type.
C: They cannot be inherited.
D: They can be virtual.
Ans: D -
You separated a derived class name from its access specifier with
A: A colon
B: Two colons
C: At least one space
D: A semi colon
Ans: B -
The members of a class by default are
A: Public
B: Protected
C: Private
D: Mandatory to specify
Ans: C -
The type of value that a function sends back to the function that calls it is known as its _____
A: type
B: return value
C: reference data
D: sentinel
Ans: B -
Which of the following are never inherited?
A: public data members
B: constructor functions
C: void functions
D: overloaded + operators
Ans: B -
A function's purpose is to print customer data. Which of the following is the best name for this function?
A: pcd(). It's short for "print customer data" and takes few keystrokes
B: Printcustomerdata(). It states everything the function will do
C: printCustomer(). It states the function's purpose and is easy to read
D: lastFunction(). It is the final function called in most programs, and this name identifies the function's timing
Ans: C -
The function strcmp("Jose", "JOSE") will return _____
A: -1
B: 0
C: 1
D: null
Ans: C -
How many types of expressions in C++?
A: 5
B: 6
C: 7
D: 8
Ans: C