Programming Languages : 2nd Day Discussion

Q. Which data type is used to represent the absence of parameters?
a) int
b) short
c) void
d) float

Answer : C

Q.  Minimum number of temporary variable needed to swap the contents of 2 variables is:
a. 1
b. 2
c. 3
d. 0

Answer : D

Explanation :
a=a+b
b=a-b
a=a-b

Q. Which of the following also known as an instance of a class?

A. Friend Functions
B. Member Variables
C. Member Functions
D. Object

Answer : D

Q. Encapsulation is known as

(A) Information hiding
(B) Data abstraction
(C) Data about data
(D) None of these

 Answer : A

Encapsulation means “we have enclosed all the characteristics of an object in the object itself”.
Encapsulation and information hiding are much related concepts (information hiding is achieved using Encapsulation). We have seen in previous lecture that object characteristics include data members and behavior of the object in the form of functions. So we can say that Data and Behavior are tightly coupled inside an object and both the information structure and implementation details of its operations are hidden from the outer world.

Q. Which datatype is used to represent the absence of parameters?
a) int
b) short
c) void
d) float

Answer : C

Q. Which of the following operators can be overloaded in C++?

(A) Scope resolution operator
(B) Size of operator
(C) Conditional operator
(D) Arithmetic operator

Answer : D

Q. C++ was developed by

(A) Dennis Ritchie
(B) Bjarne Stroustrup
(C) Tannenbaum
(D) Milan Melkovinec

 Answer :B

Q. In C++, setw is

A) initialization operator
B) conditional operator
C) memory allocation operator
D) field width operator

 Answer : D


More Questions and Discussion... 

Comments