July 8, 2021 in C and CPP
An exception is caused by
1.10An exception is caused by
A) A hardware problem
B) A problem in the operating system
C) A run-time error
D) A syntax error
July 8, 2021 in C and CPP
1.10An exception is caused by
A) A hardware problem
B) A problem in the operating system
C) A run-time error
D) A syntax error
July 8, 2021 in C and CPP
1.9 We can make a class abstract by
A) Declaring it abstract using the static keyword
B) Declaring it abstract using the virtual keyword
C) Making all member functions constant
D) Making at least one member function as pure virtual function
July 8, 2021 in C and CPP
1.8 Consider the following code definition:
class Person
{}
;
class Student: protected Person
{}
;
What happens when we try to compile this class?
A) Will not compile class body of Person is not defined
B) Will not compile because of Student is not defined
C) Will compile successfully
D) Will not compile because class Person is not public inherited.
July 8, 2021 in C and CPP
1.7 If p and q are two pointers of type int and m is an int type variable, which of the following is
legal?
A) p-q
B) p*q
C) p/q
D) m%n
July 8, 2021 in C and CPP
1.6 Which of the following is legal declaration of a reference?
A) int &a=10;
B) int &a=m;
C) int *a=&15;
D) int &a=m++;
July 8, 2021 in C and CPP
1.5 Which of the following can’t be passed to a function
A) Reference variable
B) Array
C) Class objects
D) Header files
July 8, 2021 in C and CPP
1.4 Consider the following code:
if(number>0)
cout<<”Number is Positive”;
else
cout<<”Number is Negative”;
What will be the output if number is equal to zero?
A) Number is Positive
B) Number is Negative
C) Both A) & B)
D) None of the above
July 8, 2021 in C and CPP
1.3 Inheritance is a way to
A) Create general classes from more specific classes
B) Create specific classes from more general classes
C) Improve data hiding and encapsulation
D) None of the above
July 8, 2021 in C and CPP
1.2 For representing polynomial in memory, using linked list, each node must have following
number of fields
A) 2
B) 3
C) 1
D) None of the above
July 8, 2021 in C and CPP
1.1 The range of values for the long data type on a 16-bit machine is
A) -2^31 to 2^31-1
B) -2^64 to 2^64
C) -2^63 to 2^63-1
D) -2^16 to 2^16-1