UCR_CS10_Spr15_Final (Solution).docx

# What datatype is the expression vat0at0at0 a char b

• Test Prep
• 12

This preview shows pages 9–12. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

Name (first and last): _________________________________ Username: ______________ Code Block 20 Code Block 21 bool q(int x, int y) { x = x - y; return x > y; } int main() { int a = 3; int b = 1; bool m; m = q(a, 4); // Line 1 m = q(a, b); // Line 2 return 0; } bool f(int &a, int b) { a = a * b; return a > b; } int main() { int a = 5; int b = 3; f(a, b); // 1 f(5, b); // 2 f(a, 3); // 3 f(&a, 3); // 4 return 0; } 50) Given the code block 21, which of the function calls in main would be valid? A) 1 and 3 B) 1 C) 3 D) 1, 2, and 3 E) 1, 2, 3, and 4 F) none 51) In the code block 20, what is assigned into m on line 1? A) true B) false 52) In the code block 20, what is assigned into m on line 2? A) true B) false 53) What will be the final value of count? int count = 0; for (int i = 0; i < 5; ++i) { for (int j = 0; j < i; ++j) { ++count; } } cout << count; A) 0 B) 5 C) 10 D) 11 E) 15 F) 25
Name (first and last): _________________________________ Username: ______________ Scratch Paper (must be turned in with exam)

This preview has intentionally blurred sections. Sign up to view the full version.

Name (first and last): _________________________________ Username: ______________ Scratch Paper (must be turned in with exam)
This is the end of the preview. Sign up to access the rest of the document.
• Winter '18

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern