New MCQ Questions set with Answer on the category of C/C++
Programming Language. In this set you will get 30 Objective
Questions with Answer related to C/CPP Programming Language.
Four options are given to each questions as possible answer but only one option
is the correct one, first select
your answer and tally with the given correct answer. Correct Answer
are given below of this MCQ
Question Set.
1 Which of the following function that must contain in all C++ programs?
a. start()
b. system()
c. main()
d. program()
2 What punctuation must use to end the code C/C++ expression statement?
a. . (dot)
b. ; (semi-colon)
c. : (colon)
d. ‘ (single quote)
3 What symbol must use to signal the begaining and ending of code blocks or compound statements?
a. { }
b. -> and <-
c. BEGIN and END
d. ( and )
4 Which of the following is a correct comment for comment in C programs?
a. */ Comments */
b. ** Comment **
c. /* Comment */
d. { Comment }
5 What value will return to the operating system upon the successful completion of a program?
a. -1
b. 1
c. 0
d. Programs do not return a value.
.6 Which one of the following is the correct operator to compare two variables?
a. :=
b. =
c. equal
d. ==
7 Which one of the following is not a correct variable type in C++ programs?
a. float
b. real
c. int
d. double
8 The directives for the preprocessors begin with
a. Ampersand symbol (&)
b. Two Slashes (//)
c. Number Sign (#)
d. Less than symbol (<)
9 The header file iostream includes
a. The declarations of the basic standard input-output library.
b. The streams of includes and outputs of program effect.
c. Both of these
d. None of these
10 Which one of the following is the boolean operator for logical and?
a. &
b. &&
c. |
d. |&
11 By default, members of a C++ class are:
a. Private
b. Public
c. Protected
d. None of the above
12 Which of the following statements is true in C++?
a. A struct cannot have member functions.
b. A struct cannot have private members.
c. The default access modifier of struct is public.
d. None of the above.
13 C++ supports:
a. Multiple inheritance
b. Pointer to functions
c. Recursion
d. All of the above
14 Which of the following is not a C++ keyword?
a. Extern
b. Auto
c. Inherits
d. None of the above
15 Which of the following is not a bitwise operator?
a. &&
b. <<
c. ~
d. ^
16 In C++, the expression 5/2 is evaluated to:
a. 2.5
b. 2
c. 3
d. None of the above
17 In C++, the string literal “C++” occupies exactly ………. of memory.
a. 3 bytes
b. 4 bytes
c. 5 bytes
d. 6 bytes
18 In C++, generic functions are created using the keyword:
a. Generic
b. Template
c. Class
d. Type
19 The implicit argument passed to a member function of a c++ class is called:
a. “implicit” pointer
b. “sender” object
c. “this” pointer
d. “me” object
20 The default copy constructor performs:
a. Deep copy
b. Shallow copy
c. Hard copy
d. Soft copy
21 What is the correct value to return to the operating system upon the successful completion of a program?
A. 0
B. 1
C. –1
D. Programs do not return a value.
22 What is the only function all C++ programs must contain?
A. start()
B. program()
C. system()
D. main()
23 What punctuation is used to the beginning and end of code blocks?
A. BEGIN and END
B. ( and )
C. { and }
D. -> and <-
24 What punctuation must be used to end lines of C++ code?
A. . (dot)
B. ‘ (single quote)
C. ; (semi-colon)
D. : (colon)
25 Which of the following is a correct comment?
A. */ Comments */
B. /* Comment */
C. ** Comment **
D. { Comment }
26 Which of the following is not a correct variable type?
A. double
B. float
C. int
D. real
27 Which of the following is the correct operator to compare two variables?
A. =
B. ==
C. :=
D. equal
28 Which of the following is the Boolean operator for logical and?
A. &
B. &&
C. |&
D. ||
29 The directives for the preprocessors begin with
A. Ampersand symbol (&)
B. Less than symbol (<)
C. Two Slashes (//)
D. Number Sign (#)
30 The file “iostream” includes
A. The streams of includes and outputs of program effect.
B. The declarations of the basic standard input-output library.
C. Both of these
D. None of these
Answers
1 Which of the following function that must contain in all C++ programs?
a. start()
b. system()
c. main()
d. program()
2 What punctuation must use to end the code C/C++ expression statement?
a. . (dot)
b. ; (semi-colon)
c. : (colon)
d. ‘ (single quote)
3 What symbol must use to signal the begaining and ending of code blocks or compound statements?
a. { }
b. -> and <-
c. BEGIN and END
d. ( and )
4 Which of the following is a correct comment for comment in C programs?
a. */ Comments */
b. ** Comment **
c. /* Comment */
d. { Comment }
5 What value will return to the operating system upon the successful completion of a program?
a. -1
b. 1
c. 0
d. Programs do not return a value.
.6 Which one of the following is the correct operator to compare two variables?
a. :=
b. =
c. equal
d. ==
7 Which one of the following is not a correct variable type in C++ programs?
a. float
b. real
c. int
d. double
8 The directives for the preprocessors begin with
a. Ampersand symbol (&)
b. Two Slashes (//)
c. Number Sign (#)
d. Less than symbol (<)
9 The header file iostream includes
a. The declarations of the basic standard input-output library.
b. The streams of includes and outputs of program effect.
c. Both of these
d. None of these
10 Which one of the following is the boolean operator for logical and?
a. &
b. &&
c. |
d. |&
11 By default, members of a C++ class are:
a. Private
b. Public
c. Protected
d. None of the above
12 Which of the following statements is true in C++?
a. A struct cannot have member functions.
b. A struct cannot have private members.
c. The default access modifier of struct is public.
d. None of the above.
13 C++ supports:
a. Multiple inheritance
b. Pointer to functions
c. Recursion
d. All of the above
14 Which of the following is not a C++ keyword?
a. Extern
b. Auto
c. Inherits
d. None of the above
15 Which of the following is not a bitwise operator?
a. &&
b. <<
c. ~
d. ^
16 In C++, the expression 5/2 is evaluated to:
a. 2.5
b. 2
c. 3
d. None of the above
17 In C++, the string literal “C++” occupies exactly ………. of memory.
a. 3 bytes
b. 4 bytes
c. 5 bytes
d. 6 bytes
18 In C++, generic functions are created using the keyword:
a. Generic
b. Template
c. Class
d. Type
19 The implicit argument passed to a member function of a c++ class is called:
a. “implicit” pointer
b. “sender” object
c. “this” pointer
d. “me” object
20 The default copy constructor performs:
a. Deep copy
b. Shallow copy
c. Hard copy
d. Soft copy
21 What is the correct value to return to the operating system upon the successful completion of a program?
A. 0
B. 1
C. –1
D. Programs do not return a value.
22 What is the only function all C++ programs must contain?
A. start()
B. program()
C. system()
D. main()
23 What punctuation is used to the beginning and end of code blocks?
A. BEGIN and END
B. ( and )
C. { and }
D. -> and <-
24 What punctuation must be used to end lines of C++ code?
A. . (dot)
B. ‘ (single quote)
C. ; (semi-colon)
D. : (colon)
25 Which of the following is a correct comment?
A. */ Comments */
B. /* Comment */
C. ** Comment **
D. { Comment }
26 Which of the following is not a correct variable type?
A. double
B. float
C. int
D. real
27 Which of the following is the correct operator to compare two variables?
A. =
B. ==
C. :=
D. equal
28 Which of the following is the Boolean operator for logical and?
A. &
B. &&
C. |&
D. ||
29 The directives for the preprocessors begin with
A. Ampersand symbol (&)
B. Less than symbol (<)
C. Two Slashes (//)
D. Number Sign (#)
30 The file “iostream” includes
A. The streams of includes and outputs of program effect.
B. The declarations of the basic standard input-output library.
C. Both of these
D. None of these
Answers
1
– C / 2 – B / 3 – A / 4 – C / 5 – C / 6 – D / 7 – B / 8 – C / 9 – A / 10 – B
11
– A / 12 – C /1 3 – D / 14 – C / 15 – A / 16 – B / 17 – B / 18 – B / 19 – C / 20
– B
21
– A / 22 – D / 23 – C / 24 – C / 25 – B / 26 – D / 27 – B / 28 – B / 29 – D / 30
– B
Tags
C