C++ Fundamentals | Set 1
1. Who created C++?
a) Bjarne Stroustrup
b) Dennis Ritchie
c) Ken Thompson
d) Brian Kernighan
Answer: A
Explanation: Bjarne Stroustrup is the original creator of C++ during 1979 at AT&T Bell Labs.
2. C++ Language developed at _________?
a) AT & T's Bell Laboratories of USA in 1972
b) Sun Microsystems in 1973
c) Cambridge University in 1972
d) AT & T's Bell Laboratories of USA in 1979
Answer: D
Explanation: No explanation is given for this question.
3. Which one of the following is a keyword?
a) Size
b) Key
c) Jump
d) Switch
Answer: D
Explanation: No explanation is given for this question.
4. ____ is the smallest individual unit in a program.
a) Variable
b) Control
c) Character
d) Token
Answer: D
Explanation: No explanation is given for this question.
5. Which of the following is the correct syntax of including a user defined header files in C++?
a) #include <userdefined.h>
b) #include <userdefined>
c) #include “userdefined”
d) #include [userdefined]
Answer: C
Explanation: C++ uses double quotes to include a user-defined header file. The correct syntax of including user-defined is #include “userdefinedname”.
6. Which of the following is a correct identifier in C++?
a) 7var_name
b) 7VARNAME
c) VAR_1234
d) $var_name
Answer: C
Explanation: The rules for writing an identifier is as follows:
i) may contain lowercase/uppercase letters, digits or underscore(_) only
ii) should start with a non-digit character
iii) should not contain any special characters like @, $, etc.
7. Which of the following is called address operator?
a) *
b) &
c) _
d) %
Answer: B
Explanation: & operator is called address operator and is used to access the address of a variable.
8. C++ is _______ type of programming language.?
a) Object Oriented
b) Procedural
c) Bit level language
d) Functional
Answer: A
Explanation: C++ is object-oriented programming language. It is an extension to C programming. It is created by Bjarne Stroustrup and his team at Bell Laboratories in 1979.
9. Which of the following is used for comments in C++?
a) // comment
b) /* comment */
c) both // comment or /* comment */
d) // comment */
Answer: C
Explanation: Both the ways are used for commenting in C++ programming. // is used for single line comments and /* … */ is used for multiple line comments.
10. What are the actual parameters in C++?
a) Parameters with which functions are called
b) Parameters which are used in the definition of a function
c) Variables other than passed parameters in a function
d) Variables that are never used in the function
Answer: A
Explanation: Actual parameters are those using which a function call is made i.e. which are actually passed in a function when that function is called.