A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. How any types of linkage are there in c++?
a. 1
b. 2
c. 3
d. 4
View Answer Report Discuss Too Difficult!
Answer: (c).3

2. To use internal linkage we have to use which keyword?
a. static
b. extern
c. static or extern
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).static

3. Which one is used to refer to program elements in any translation units?
a. internal linkage
b. external linkage
c. no linkage
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).external linkage

4. What will be the output of these two programs?
1.

    #ifndef Exercise_H
    #define Exercise_H
    int num = 842;
    #endif

2.

    #include <iostream>
    #include "exe.h"
    using namespace std;
    int main(int argc, char * argv[] )
    {
        cout << number++;
        return 0;
    }
a. 842
b. 843
c. compile time error
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).842

5. What is the defualt type oof linkage that are available for identifires?
a. internal
b. external
c. no linkage
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).external

6. To use external linkage we have to use which keyword?
a. static
b. extern
c. const
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).extern

7. Which is used to use a function from one source file to another?
a. code
b. declaration
c. prototype
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (c).prototype

8. What is the use of no linkage?
a. make the entity visible to other programs
b. make the entity visible to other blocks in the same program.
c. make the entity visible only to that block
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (c).make the entity visible only to that block

9. What is the user-defined header file extension in c++?
a. cpp
b. h
c. hf
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).h

10. Which of the following keyword is used to declare the header file?
a. include
b. exclude
c. string
d. namespace
View Answer Report Discuss Too Difficult!
Answer: (a).include

Page 1 of 39