FSU COP3330 Exam 2 Questions with
Answers 100% Pass
Given this code fragment:
unsigned int n = 3;
n = (n << 5);
std::cout << n;
What value is output to screen? - CORRECT ANSWER-96
Given this code fragment:
unsigned int n = 55;
n = (n >> 2)
std::cout << n;
What value is output to screen? - CORRECT ANSWER-13
,Which of the following code fragments produces the output z = 1.5
a)
int x = 1;
int y = 2;
float z = x/2 + y/2;
std::cout << "z = " << z << '\n';
b)
int x = 1;
int y = 2;
float z = (x + y)/y;
std::cout << "z = " << z << '\n';
c)
int x = 1;
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED
, int y = 2;
float z = (x + y)/2;
std::cout << "z = " << z << '\n';
d)
int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n'; - CORRECT ANSWER-int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n';
What is the output from the following code fragment?
int n = 2;
int m;
++n;
m = n--;
Answers 100% Pass
Given this code fragment:
unsigned int n = 3;
n = (n << 5);
std::cout << n;
What value is output to screen? - CORRECT ANSWER-96
Given this code fragment:
unsigned int n = 55;
n = (n >> 2)
std::cout << n;
What value is output to screen? - CORRECT ANSWER-13
,Which of the following code fragments produces the output z = 1.5
a)
int x = 1;
int y = 2;
float z = x/2 + y/2;
std::cout << "z = " << z << '\n';
b)
int x = 1;
int y = 2;
float z = (x + y)/y;
std::cout << "z = " << z << '\n';
c)
int x = 1;
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED
, int y = 2;
float z = (x + y)/2;
std::cout << "z = " << z << '\n';
d)
int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n'; - CORRECT ANSWER-int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n';
What is the output from the following code fragment?
int n = 2;
int m;
++n;
m = n--;