CSCI 121 Final Exam Questions With
100% Verified Answers
Which of the following is an input device for a computer?
a. CPU
b. Monitor
c. Mouse
d. Printer
e. Memory -
correct 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; -
correct answer ✅d
Which of the following is correct?
a. #include < iostream>
b. #include <iostream>
,CSCI 121 Final Exam Questions With
100% Verified Answers
c. #include <iostream >
d. All of a, b, and c
*pg. 26 -
correct answer ✅b
Which of the following prints out a tab space?
a. cout << "\t";
b. cout >> "\t";
c. cout << "/t";
d. cout >> "/t"; -
correct answer ✅a
C++ source code is saved in a file with extension _____________
a. .obj
b. .cpp
c. .txt
d. .exe -
correct answer ✅b
,CSCI 121 Final Exam Questions With
100% Verified Answers
Which of the following is a legal C/C++ identifier?
a. how?
b. 2how
c. how2
d. #how
*pg. 43 -
correct answer ✅c
Which of the following is the correct way to declare an int variable
named num_of_items+and
initialize it to 10?
a. Int num_of_items = 10;
b. int num_of_items[10];
c. int num_of_items(10);
d. none of the above
pg. 49 -
correct answer ✅c
, CSCI 121 Final Exam Questions With
100% Verified Answers
Which of the following is the correct C/C++ expression for math
expression square root of (2x + y)
a. sqrt(2*x+y)
b. sqrt(2x+y)
c. square(2*x+y)
d. square(2x+y) -
correct answer ✅a
What is the error in the following statement? Assume that x, and y
are declared and initialized.
if(x > y)
cout << x << " is smaller than " << y << endl;
a. syntax error
b. logic error
c. running time error
d. no error
pg. 30 -
correct answer ✅b
100% Verified Answers
Which of the following is an input device for a computer?
a. CPU
b. Monitor
c. Mouse
d. Printer
e. Memory -
correct 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; -
correct answer ✅d
Which of the following is correct?
a. #include < iostream>
b. #include <iostream>
,CSCI 121 Final Exam Questions With
100% Verified Answers
c. #include <iostream >
d. All of a, b, and c
*pg. 26 -
correct answer ✅b
Which of the following prints out a tab space?
a. cout << "\t";
b. cout >> "\t";
c. cout << "/t";
d. cout >> "/t"; -
correct answer ✅a
C++ source code is saved in a file with extension _____________
a. .obj
b. .cpp
c. .txt
d. .exe -
correct answer ✅b
,CSCI 121 Final Exam Questions With
100% Verified Answers
Which of the following is a legal C/C++ identifier?
a. how?
b. 2how
c. how2
d. #how
*pg. 43 -
correct answer ✅c
Which of the following is the correct way to declare an int variable
named num_of_items+and
initialize it to 10?
a. Int num_of_items = 10;
b. int num_of_items[10];
c. int num_of_items(10);
d. none of the above
pg. 49 -
correct answer ✅c
, CSCI 121 Final Exam Questions With
100% Verified Answers
Which of the following is the correct C/C++ expression for math
expression square root of (2x + y)
a. sqrt(2*x+y)
b. sqrt(2x+y)
c. square(2*x+y)
d. square(2x+y) -
correct answer ✅a
What is the error in the following statement? Assume that x, and y
are declared and initialized.
if(x > y)
cout << x << " is smaller than " << y << endl;
a. syntax error
b. logic error
c. running time error
d. no error
pg. 30 -
correct answer ✅b