July 9, 2021 in C and CPP
How many constructors a class have?
1.9 How many constructors a class have?
A) 0
B) 1
C) 2
D) any number
July 9, 2021 in C and CPP
1.9 How many constructors a class have?
A) 0
B) 1
C) 2
D) any number
July 9, 2021 in C and CPP
1.8 Which of the following is an abstract function?
A) virtual double getArea();
B) virtual double getArea() = 0;
C) double getArea() = 0;
D) double getArea();
July 9, 2021 in C and CPP
1.7 Suppose circle1 and circle2 are two Circle objects. What does the following statement do?
circle2 = circle1;
A) It copies the contents of circle1 to circle2
B) It makes circle2 and circle1 the same object
C) It copies the contents of circle2 to circle1
D) The statement is illegal
July 9, 2021 in C and CPP
1.6 Which of the following can not be overloaded?
A) new
B) delete
C) ?:
D) All of the above
July 9, 2021 in C and CPP
1.5 If changes made to the formal argument of a function are reflected in actual argument
passed to the function it is referred as
A) function invocation
B) call by value
C) call by reference
D) call by name
July 9, 2021 in C and CPP
1.4 What is the value in count after the following loop is executed?
int count = 0;
do
{
cout << "Welcome to C++";
} while (count++ < 9);
cout << count;
A) 8
B) 9
C) 10
D) 11
July 9, 2021 in C and CPP
1.3 Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
A) 1 < x < 100 && x < 0
B) ((x < 100) && (x > 1)) || (x < 0)
C) ((x < 100) && (x > 1)) && (x < 0)
D) (1 > x > 100) || (x < 0)
July 9, 2021 in C and CPP
1.2 A pointer can hold
A) The address of another variable
B) Stored value of the variable
C) Initialization of the variable
D) The address of the same variable
July 9, 2021 in C and CPP
1.1 The main function header can be written as
A) public static void main(int argc, char* argv)
B) public int main(String[] args)
C) public static main(String[] args)
D) void main(int argc, char* argv[])
July 9, 2021 in C and CPP
9. Write short notes on any three:
a) Stream classes
b) Friend function
c) Exception handling
d) Multiple inheritance