Verifone Previous Years Solved Sample Placement Papers
-
What will be the output of the following program?
#include <iostream.h> void main() { float x; x = (float)9/2; cout << x; }
A: 4.5
B: 4.0
C: 4
D: 5
Ans: A -
The term __________ means the ability to take many forms.
A: Inheritance
B: Polymorphism
C: Member function
D: Encapsulation
Ans: B -
Runtime polymorphism is achieved by
A: Friend function
B: Virtual function
C: Operator overloading
D: Function overloading
Ans: B -
Access to private data
A: Restricted to methods of the same class
B: Restricted to methods of other classes
C: Available to methods of the same class and other classes
D: Not an issue because the program will not compile
Ans: B -
Additional information sent when an exception is thrown may be placed in
A: The throw keyword
B: The function that caused the error
C: The catch block
D: An object of the exception class
Ans: C -
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 -
main(int argc, char *argv[])
{
(main && argc) ? main(argc-1, NULL) : return 0;
}
a. Runtime error.
b. Compile error. Illegal syntax Ans: b. Compile error. Illegal syntax
c. Gets into Infinite loop
d. None of the above
-
main()
{
int i;
float *pf;
pf = (float *)&i;
*pf = 100.00;
printf("%d", i);
}
a. Runtime error.
b. 100
c. Some Integer not 100 Ans: c. Some Integer not 100
d. None of the above
-
main()
{
int i = 0xff;
printf("%d", i<<2);
}
a. 4
b. 512
c. 1020
d. 1024 Ans: d. 1024
-
#define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15
d. none of the above Ans: d. none of the above
-
union u
{
struct st
{
int i : 4;
int j : 4;
int k : 4;
int l;
} st;
int i;
} u;
main()
{
u.i = 100;
printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}
a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0 Ans: c. 100, 4, 0
d. 40, 4, 0
-
union u
{
union u
{
int i;
int j;
} a[10];
int b[10];
} u;
main()
{
printf("%d", sizeof(u));
printf("%d", sizeof(u.a));
printf("%d", sizeof(u.a[0].i));
}
a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0 Ans: d. 40, 4, 0
-
main()
{
int (*functable[2])(char *format, ...) ={printf, scanf};
int i = 100;
(*functable[0])("%d", i);
(*functable[1])("%d", i);
(*functable[1])("%d", i);
(*functable[0])("%d", &i);
}
a. 100, Runtime error.
b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number Ans: d. 100, Random number