100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CSCI 121 FINAL EXAM QUESTIONS & ANSWERS

Rating
-
Sold
-
Pages
14
Grade
A+
Uploaded on
05-08-2025
Written in
2025/2026

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

Show more Read less
Institution
CSCI 121
Course
CSCI 121









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSCI 121
Course
CSCI 121

Document information

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

Subjects

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

Get to know the seller

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 YALA UNIVERSITY
View profile
Follow You need to be logged in order to follow users or courses
Sold
2009
Member since
3 year
Number of followers
1447
Documents
48318
Last sold
16 hours ago

3.8

344 reviews

5
171
4
61
3
44
2
16
1
52

Recently viewed by you

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

Frequently asked questions