• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

C++ Programming Multiple Choice Final Questions With Answers

Document preview thumbnail
Preview 2 out of 9 pages

C++ Programming Multiple Choice Final Questions With Answers

Content preview

C++ Programming Multiple Choice Final
Questions With Answers
Question 1.
x = 10, y = 7, and z, a, and b are all int variables. a = x >= y;
Correct Answer: 1

Question 2.
When a relational expression is false, it has the value
Correct Answer: Zero

Question 3.
What will following segment of code output?
Correct Answer: This is true! This is all folks!

Question 4.
What will the following segment of code output? You can assume the user
enters a grade of 90 from the keyboard.
cout << "Enter a test score: ";
cin >> test_score;
if (test_score < 60);
cout << "You failed the test!" << endl;
if (test_score > 60)
cout << "You passed the test!" << endl;
else
cout << "You need to study for the next test!";
Correct Answer: You failed the test You Passed the test!

Question 5.
This Operator represents the logical AND
Correct Answer: &&

Question 6.
This operator takes an operand and reverses its truth or falsehood.
Correct Answer: !

,Question 7.
What is the output of the following segment of code if 4 is input by the user
when asked to enter a number?
int num;
int total = 0;
cout << "Enter a number from 1 to 10: ";
cin >> num;
switch (num)
{
case 1:
case 2: total = 5;
case 3: total = 10;
case 4: total = total + 3;
case 8: total = total + 6;
default: total = total + 4;
}
cout << total << endl;
Correct Answer: 13

Question 8.
. What will the following segment of code output? score = 40;
if (score > 95)
cout << "Congratulations!\n";
cout << "That's a high score!\n";
cout << "This is a test question!" << endl;
Correct Answer: That's a high score This is a Test Question!

Question 9.
Operator is used in C++ to represent equality.
Correct Answer: ==

Question 10.
Assuming x is 5, y is 6, and z is 8, which of the following is false?
1. x == 5;
2. 7 <= (x + 2);
3. z < = 4;
4. (1 + x) != y;
5. z >= 8;
6. x >= 0;
7. x <= (y * 2)
Correct Answer: 3 & 4 are false

Document information

Uploaded on
December 4, 2026
Number of pages
9
Written in
2026/2027
Type
Exam (elaborations)
Contains
Unknown
$15.98

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Favorgrades
3.8
(200)
Sold
865
Followers
376
Items
64193
Last sold
19 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions