Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 14 pages
Exam (elaborations)

CSCI 121 FINAL EXAM QUESTIONS & ANSWERS

Document preview thumbnail
Preview 2 out of 14 pages

Which of the following is a correct way to print out "Hello World!" on the screen and the cursor goes to the new line after the printing finished. a. cout "Hello, World!n" ; b. cout "Hello, World!/n" ; c. cout "Hello, World!" endl ; d. cout "Hello, World!" endl; - Answer -d Which of the following is correct? a. #include iostream b. #include iostream c. #include iostream d. All of a, b, and c *pg. 26 - Answer -b What will be the output of the following code? Assume that originally int type variable x = 6 if(x % 3 == 0) cout x " is a multiple of 3 " endl; else cout x " is not a multiple of 3 " endl; a. 6 is a multiple of 3 b. 6 is not a multiple of 3 c. x is a multiple of 3 d. x is not a multiple of 3 e. There is a syntax error - Answer -a How many numbers will the following code print out? Assume int x = 6; before the loop. do { cout x endl; x--; } while (x 6); a. one

Content preview

CSCI 121 FINAL EXAM QUESTIONS & ANSWERS

Which of the following is an input device for a computer?
a. CPU
b. Monitor
c. Mouse
d. Printer
e. Memory - Answer -c

Which of the following is a correct way to print out "Hello World!" on the screen and the
cursor
goes to the new line after the printing finished.
a. cout >> "Hello, World!\n" ;
b. cout << "Hello, World!/n" ;
c. cout >> "Hello, World!" << endl ;
d. cout << "Hello, World!" << endl; - Answer -d

Which of the following is correct?
a. #include < iostream>
b. #include <iostream>
c. #include <iostream >
d. All of a, b, and c

*pg. 26 - Answer -b

What will be the output of the following code? Assume that originally int type variable x
=6
if(x % 3 == 0)
cout << x << " is a multiple of 3 " << endl;
else
cout << x << " is not a multiple of 3 " << endl;
a. 6 is a multiple of 3
b. 6 is not a multiple of 3
c. x is a multiple of 3
d. x is not a multiple of 3
e. There is a syntax error - Answer -a

How many numbers will the following code print out?
Assume int x = 6; before the loop.
do {
cout << x << endl;
x--;
} while (x > 6);

a. one

, b. six
c. zero
d. infinite
e. There is a syntax error - Answer -a

Which of the following declares a constant variable named TAX_RATE with type double
and
initialize it to 0.085?
a. constant double x = 0.085.
b. const double x = 0.085.
c. const double x = 0.085;
d. constant double x = 0.085;

pg. 97 - Answer -c

What is the value of sum after the execution of the following loop?
int sum = 0;
int n = 5;
while(n > 0) {
sum += n;
n = n - 1;
}
a. 15
b. 14
c. infinite
d. There is a syntax error. - Answer -a

Evaluate the following Boolean expression: true || false && true
a. true || false && true = true || (false && true) = true || false = true
b. true || false && true = (true || false) && true = true && true = true
c. false
d. It cannot be determined. You need add parenthesis.

pg. 114 - Answer -a

Suppose int x = 5; what is the output of the following statement?
if( x > 10)
cout << "Hello";
else if (x > 6)
cout << "World";
else
cout << "Hi";
a. Hello
b. World
c. HelloWorld
d. Hi

Document information

Uploaded on
August 5, 2025
Number of pages
14
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$14.99

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.
GEEKA
3.8
(360)
Sold
2133
Followers
1447
Items
58039
Last sold
4 days 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