Professional Documents
Culture Documents
C
C
Question1.What is the correct value to return to the operating system upon the
successful completion of a program?
C. 0
Question 2.What is the only function all C++ programs must contain?
C. main()
Question 3.What punctuation is used to signal the beginning and end of code
blocks?
A. { }
Question 7.Which of the following is the correct operator to compare two variables?
l
D. ==
Set 2
Question 1Identify the correct statement
Question 4
There is a unique function in C++ program by where all C++ programs start their
execution
c. Main()
Question 5
b. Parenthesis
Question 7
c. A Semicolon
a = b = c = 5;
a = 11 % 3
a. True
Question 3:
To increase the value of c by one which of the following statement is wrong?
a. c++;
b. c = c + 1;
d. c += 1
Question 4:
When following piece of code is executed, what happens?
b = 3;
a = b++;
Question 5:
The result of a Relational operation is always
Question 6:
Which of the following is a valid relational operator?
a. == , >=
Question 7:
What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?
A. 10
Question 8:
When does the code block following while(x<100) execute?
B. do while
C. while
Question 10:
How many times is a do while loop guaranteed to loop?
C. 1
Set 3
Question 1 A variable is/are
a. Letters
b. Digits
c. Underscores
Question 3 Which of the following identifiers is valid?
a. papername
b. writername
d. printname
b. bittand
c. biand
d. band
a. The first one refers to a variable whose identifier is x and the second one refers
to the character constant x
a. \t
b. \v
c. \f
Question 7
a. String Literals can extend to more than a single line of code by putting a
backslash sign at the end of each unfinished line.
b. You can also concatenate several string constants separating them by one or
several blank spaces, tabulators, newline or any other valid blank character
Question 10
In an assignment statement
c. The assignment always takes place from right to left and never the other way
http://www.psexam.com/Multiple-Choice-Questions-MCQs-from-C++/c-plus-plus-
mcq-ebook-download.html
Answers
3. c. Typename
4. a. Bitand
5. a. The first one refers to a variable whose identifier is x and the second one
refers to the character constant x
6. d. \w
7. d. All of above